Exemplo n.º 1
0
        public void OnGUI(Rect rect)
        {
            if (ParameterControllerView.s_Styles == null)
            {
                ParameterControllerView.s_Styles = new ParameterControllerView.Styles();
            }
            Event current = Event.current;

            if (current.type == EventType.MouseDown && rect.Contains(current.mousePosition))
            {
                this.m_HadKeyFocusAtMouseDown = this.m_ParameterList.HasKeyboardControl();
            }
            this.KeyboardHandling();
            if (this.m_Host.animatorController == null)
            {
                return;
            }
            this.DoParameterList();
        }
Exemplo n.º 2
0
 public void OnToolbarGUI()
 {
     if (ParameterControllerView.s_Styles == null)
     {
         ParameterControllerView.s_Styles = new ParameterControllerView.Styles();
     }
     if (this.m_Host == null)
     {
         return;
     }
     using (new EditorGUI.DisabledScope(this.m_Host.animatorController == null))
     {
         string[] names      = Enum.GetNames(typeof(ParameterControllerView.SearchMode));
         int      searchMode = this.m_SearchMode;
         GUI.SetNextControlName("ParameterSearch");
         if (Event.current.type == EventType.KeyDown && Event.current.keyCode == KeyCode.Escape && GUI.GetNameOfFocusedControl() == "ParameterSearch")
         {
             this.m_Search = string.Empty;
             this.CreateSearchParameterList(this.m_Search, this.m_SearchMode);
         }
         EditorGUI.BeginChangeCheck();
         string search = EditorGUILayout.ToolbarSearchField(this.m_Search, names, ref searchMode, new GUILayoutOption[0]);
         if (EditorGUI.EndChangeCheck())
         {
             this.m_Search     = search;
             this.m_SearchMode = searchMode;
             this.CreateSearchParameterList(this.m_Search, this.m_SearchMode);
         }
         GUILayout.Space(10f);
         using (new EditorGUI.DisabledScope(this.m_Host.liveLink))
         {
             Rect rect = GUILayoutUtility.GetRect(ParameterControllerView.s_Styles.iconToolbarPlusMore, ParameterControllerView.s_Styles.invisibleButton);
             if (GUI.Button(rect, ParameterControllerView.s_Styles.iconToolbarPlusMore, ParameterControllerView.s_Styles.invisibleButton))
             {
                 this.OnAddParameter(rect);
             }
         }
     }
 }