Example #1
0
        private float currentAngle; //Keep track of angle for when we click

        private void Awake()
        {
            menu = GetComponent <RadialMenu>();
            if (events == null)
            {
                events = GetComponentInParent <VRTK_ControllerEvents>();
            }
        }
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            RadialMenu rMenu = (RadialMenu)target;

            if (GUILayout.Button("Regenerate Buttons"))
            {
                rMenu.RegenerateButtons();
            }
        }
Example #3
0
        private float currentAngle; //Keep track of angle for when we click

        void Start()
        {
            menu = GetComponent <RadialMenu>();
            if (events == null)
            {
                events = GetComponentInParent <VRTK_ControllerEvents>();
            }
            if (events == null)
            {
                Debug.LogError("The radial menu must be a child of the controller or be set in the inspector!");
            }
            else
            {   //Start listening for controller events
                events.TouchpadPressed     += new ControllerInteractionEventHandler(DoTouchpadClicked);
                events.TouchpadReleased    += new ControllerInteractionEventHandler(DoTouchpadUnclicked);
                events.TouchpadTouchStart  += new ControllerInteractionEventHandler(DoTouchpadTouched);
                events.TouchpadTouchEnd    += new ControllerInteractionEventHandler(DoTouchpadUntouched);
                events.TouchpadAxisChanged += new ControllerInteractionEventHandler(DoTouchpadAxisChanged);
            }
        }
 void Start()
 {
     menu = GetComponent<RadialMenu>();
     if (events == null)
     {
         events = GetComponentInParent<VRTK_ControllerEvents>();
     }
     if (events == null)
     {
         Debug.LogError("The radial menu must be a child of the controller or be set in the inspector!");
     }
     else
     {   //Start listening for controller events
         events.TouchpadPressed += new ControllerInteractionEventHandler(DoTouchpadClicked);
         events.TouchpadReleased += new ControllerInteractionEventHandler(DoTouchpadUnclicked);
         events.TouchpadTouchStart += new ControllerInteractionEventHandler(DoTouchpadTouched);
         events.TouchpadTouchEnd += new ControllerInteractionEventHandler(DoTouchpadUntouched);
         events.TouchpadAxisChanged += new ControllerInteractionEventHandler(DoTouchpadAxisChanged);
     }
 }
        private void Awake()
        {
            menu = GetComponent <RadialMenu>();

            Initialize();
        }
Example #6
0
        protected virtual void Awake()
        {
            menu = GetComponent <RadialMenu>();

            Initialize();
        }
        private void Awake()
        {
            menu = GetComponent<RadialMenu>();

            Initialize();
        }