示例#1
0
        //TODO: add left or right controller target
        /// <summary>
        /// This is to update the menu on the controllers according to which object you point to
        /// </summary>
        /// <param name="type"></param>
        public void setMenuItem(DOOType type)
        {
            leftmenuui.hideMenu();

            // find matching action and trigger that
            MenuItem val;

            if (leftMenuMap.TryGetValue(type, out val))
            {
                val.drawMenuLabels();
            }
            else
            {
                Debug.Log("no action bro");
                leftmenuui.hideMenu();
            }
        }
示例#2
0
 public void OnGlobalTouchpadPressDown(ViveControllerModule.EventData eventData)
 {
     //is left menu
     if (eventData.viveControllerModule.Controller.index == leftcontrollerid)
     {
         DOOType type = eventData.currentRaycast.gameObject.GetComponentInChildren <DOOObject>().type;
         // find matching main menu from DOO type
         MenuItem mainmenu;
         if (leftMenuMap.TryGetValue(type, out mainmenu))
         {
             //find matching submenu from Direction
             MenuItem submenu;
             if (mainmenu.submenuitems.TryGetValue(ParseDirection(eventData), out submenu))
             {
                 currentEditingObject = submenu.trigger(eventData.currentRaycast.gameObject, eventData);
                 mainmenu.ui.setSelected(ParseDirection(eventData));
             }
             else
             {
                 Debug.Log("no action bro");
             }
         }
         else
         {
             //no menu found
         }
     }
     // no its actually right menu
     else
     {
         //find matching submenu from Direction
         MenuItem submenu;
         if (rightmenu.submenuitems.TryGetValue(ParseDirection(eventData), out submenu))
         {
             submenu.trigger(MainMenuManager.Instance.gameObject, eventData);
             //rightmenu.ui.setSelected(ParseDirection(eventData));
         }
         else
         {
             Debug.Log("no action bro");
         }
     }
 }