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