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