private void ShowButton(Rect position) { if (AnimatorControllerTool.s_Styles == null) { AnimatorControllerTool.s_Styles = new AnimatorControllerTool.Styles(); } bool flag = GUI.Toggle(position, this.isLocked, GUIContent.none, AnimatorControllerTool.s_Styles.lockButtonStyle); if (flag != this.isLocked) { this.FlipLocked(); } }
public void OnGUI() { using (new AnimatorControllerTool.ScopedPreventWarnings(this.previewAnimator)) { EventType type = Event.current.type; int button = Event.current.button; base.autoRepaintOnSceneChange = true; if (AnimatorControllerTool.s_Styles == null) { AnimatorControllerTool.s_Styles = new AnimatorControllerTool.Styles(); } this.OnControllerChange(); BlendTreeInspector.currentController = this.m_AnimatorController; BlendTreeInspector.currentAnimator = this.m_PreviewAnimator; if (this.miniTool) { Rect paneRect = new Rect(0f, 0f, base.position.width, base.position.height); this.OnGUIGraph(paneRect); } else { if (this.m_VerticalSplitter == null || this.m_VerticalSplitter.realSizes.Length != 2) { this.m_VerticalSplitter = new SplitterState(new int[] { (int)(base.position.width * 0.25f), (int)(base.position.width * 0.75f) }, new int[] { 150, 100 }, null); } SplitterGUILayout.BeginHorizontalSplit(this.m_VerticalSplitter, new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) }); SplitterGUILayout.EndHorizontalSplit(); int num = this.m_VerticalSplitter.realSizes[0]; int num2 = this.m_VerticalSplitter.realSizes[1]; Rect rect = new Rect(0f, 0f, (float)num, base.position.height); Rect paneRect2 = new Rect((float)num, 0f, (float)num2, base.position.height); Rect topToolBarRect = new Rect(rect.x, rect.y, rect.width, 17f); this.OnGUIEditorToolbar(topToolBarRect); Rect editorRect = new Rect(0f, 17f, rect.width, rect.height - 17f); this.OnGUIEditor(editorRect); if (Event.current.type == EventType.MouseDown && this.editor.HasKeyboardControl()) { this.editor.ReleaseKeyboardFocus(); } else if (this.activeGraphGUI != null && type == EventType.MouseDown && type != Event.current.type) { this.activeGraphGUI.ClearSelection(); } this.OnGUIGraph(paneRect2); } if (Event.current.type == EventType.MouseDown) { GUIUtility.keyboardControl = 0; EditorGUI.EndEditingActiveTextField(); } if (this.activeGraphGUI != null && type == EventType.MouseDown && button == 0 && this.activeGraphGUI.selection.Count == 0 && this.activeGraphGUI.edgeGUI.edgeSelection.Count == 0) { this.activeGraphGUI.DoBackgroundClickAction(); } } }