public override void DoButton(Selector cursor, Selector.Button button, bool state) { Debug.Log("Button:" + button + " State:" + state); if (state && button == Selector.Button.PadClicked) { lineray.enabled = true; SteamVR_Fade.Start(Color.clear, 0f); SteamVR_Fade.Start(Color.black, 1f); VRperson_pos.position = cursor.Cursor.localPosition; SteamVR_Fade.Start(Color.black, 0f); SteamVR_Fade.Start(Color.clear, 1f); } }
public override void DoButton(Selector cursor, Selector.Button button, bool state) { base.DoButton(cursor, button, state); if (button == Selector.Button.Gripped) { if (input_module != null) { input_module.UpdateFocus(canvas.worldCamera.WorldToScreenPoint(cursor.Cursor.localPosition)); if (state) { input_module.DoPress(); } else { input_module.DoRelease(); } } } }
//public enum Button { Trigger, Menu, PadClicked, PadTouched, Gripped } public void SetButton(Selector.Button button, bool state) { switch (button) { case Selector.Button.Trigger: if (TriggerClicked != null) { TriggerClicked(state); } break; case Selector.Button.Menu: if (MenuClicked != null) { MenuClicked(state); } break; case Selector.Button.PadClicked: if (PadClicked != null) { PadClicked(state); } break; case Selector.Button.PadTouched: if (PadTouched != null) { PadTouched(state); } break; case Selector.Button.Gripped: if (Gripped != null) { Gripped(state); } break; } }
public virtual void DoButton(Selector cursor, Selector.Button button, bool state) { }