// Register a callback using this method in order to receive a callback for button up // events of the specified name. // Example: // public void OnWandBtnUp() { // Debug.Log("Button Down!"); // } // // public void Start() { // MinVR.VRMain.Instance.AddOnVRButtonUpCallback("WandBtn1_Up", this.OnWandBtnUp); // } public void AddOnVRButtonUpCallback(string eventName, OnVRButtonUpEventDelegate func) { if (!buttonUpCallbacks.ContainsKey(eventName)) { buttonUpCallbacks.Add(eventName, new List <OnVRButtonUpEventDelegate>()); } buttonUpCallbacks[eventName].Add(func); }
public static void AddVRButtonCallbacks( this VRMain instance, string eventName, OnVRButtonUpEventDelegate onButtonUp, OnVRButtonDownEventDelegate onButtonDown) { instance.AddOnVRButtonUpCallback(eventName, onButtonUp); instance.AddOnVRButtonDownCallback(eventName, onButtonDown); }