Exemplo n.º 1
0
 void OpenMenu()
 {
     mSceneMenuVisible = true;
     isVisible         = mSceneMenuVisible;
     mSelectedEntry    = null;
     GUI.FocusControl(kMenuTextField);
 }
Exemplo n.º 2
0
        void Execute(SceneMenuCommand pCommand)
        {
            pCommand.Execute();

            if (!mLastCommandHadError)
            {
                SceneView.currentDrawingSceneView.ShowNotification(new GUIContent(pCommand.mName));
            }

            mLastCommandHadError = false;
        }
Exemplo n.º 3
0
        void SelectNextMenuEntry()
        {
            if (mFilteredMenuCommands.Count == 0)
            {
                return;
            }

            if (!mFilteredMenuCommands.Contains(mSelectedEntry))
            {
                mSelectedEntry = mFilteredMenuCommands[0];
                return;
            }

            int idx = mFilteredMenuCommands.IndexOf(mSelectedEntry) - 1 + mFilteredMenuCommands.Count;

            mSelectedEntry = mFilteredMenuCommands[idx % mFilteredMenuCommands.Count];
        }
Exemplo n.º 4
0
 void FilterCommands(string pFilter)
 {
     pFilter = pFilter.ToLower();
     mFilteredMenuCommands = new List <SceneMenuCommand>();
     foreach (var c in mMenuCommands)
     {
         if (c.mName.ToLower().StartsWith(pFilter))
         {
             mFilteredMenuCommands.Add(c);
         }
     }
     if (mFilteredMenuCommands.Count > 0)
     {
         mSelectedEntry = mFilteredMenuCommands[0];
     }
     else
     {
         mSelectedEntry = null;
     }
 }
Exemplo n.º 5
0
        void RenderMenuEntry(SceneMenuCommand pCommand)
        {
            GUILayout.BeginHorizontal();
            if (pCommand == mSelectedEntry)
            {
                GUI.color = new Color(0.2f, 0.6f, 1.0f, 1.0f);
            }
            else
            {
                GUI.color = Color.white;
            }

            GUILayout.Label(pCommand.mName, EditorStyles.whiteLabel);

            GUILayout.FlexibleSpace();

            GUILayout.Label(pCommand.GetFormattedShortCut(), EditorStyles.whiteLabel);

            GUILayout.EndHorizontal();
        }