コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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();
                    }
                }
            }
        }
コード例 #3
0
        //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;
            }
        }
コード例 #4
0
 public virtual void DoButton(Selector cursor, Selector.Button button, bool state)
 {
 }