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

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

        mLastCommandHadError = false;
    }
Ejemplo 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];
    }
Ejemplo n.º 4
0
 void FilterCommands(string pFilter)
 {
     pFilter = pFilter.ToLower();
     mFilteredMenuCommands = new List <LESceneMenuCommand>();
     foreach (var c in mMenuCommands)
     {
         if (c.mName.ToLower().StartsWith(pFilter))
         {
             mFilteredMenuCommands.Add(c);
         }
     }
     if (mFilteredMenuCommands.Count > 0)
     {
         mSelectedEntry = mFilteredMenuCommands[0];
     }
     else
     {
         mSelectedEntry = null;
     }
 }
Ejemplo n.º 5
0
    void RenderMenuEntry(LESceneMenuCommand 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();
    }