예제 #1
0
 // 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);
 }
예제 #2
0
 public static void AddVRButtonCallbacks(
     this VRMain instance,
     string eventName,
     OnVRButtonUpEventDelegate onButtonUp,
     OnVRButtonDownEventDelegate onButtonDown)
 {
     instance.AddOnVRButtonUpCallback(eventName, onButtonUp);
     instance.AddOnVRButtonDownCallback(eventName, onButtonDown);
 }