private void ConnectionStateGUI() { if (HolographicEmulationWindow.s_ConnectedTexture == null) { HolographicEmulationWindow.s_ConnectedTexture = EditorGUIUtility.LoadIconRequired("sv_icon_dot3_sml"); HolographicEmulationWindow.s_ConnectingTexture = EditorGUIUtility.LoadIconRequired("sv_icon_dot4_sml"); HolographicEmulationWindow.s_DisconnectedTexture = EditorGUIUtility.LoadIconRequired("sv_icon_dot6_sml"); } Texture2D image; GUIContent label; GUIContent content; switch (this.m_ConnectionState) { case HolographicStreamerConnectionState.Disconnected: IL_5E: image = HolographicEmulationWindow.s_DisconnectedTexture; label = HolographicEmulationWindow.s_ConnectionStateDisconnectedText; content = HolographicEmulationWindow.s_ConnectionButtonConnectText; goto IL_A3; case HolographicStreamerConnectionState.Connecting: image = HolographicEmulationWindow.s_ConnectingTexture; label = HolographicEmulationWindow.s_ConnectionStateConnectingText; content = HolographicEmulationWindow.s_ConnectionButtonDisconnectText; goto IL_A3; case HolographicStreamerConnectionState.Connected: image = HolographicEmulationWindow.s_ConnectedTexture; label = HolographicEmulationWindow.s_ConnectionStateConnectedText; content = HolographicEmulationWindow.s_ConnectionButtonDisconnectText; goto IL_A3; } goto IL_5E; IL_A3: EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.PrefixLabel(HolographicEmulationWindow.s_ConnectionStatusText, "Button"); float singleLineHeight = EditorGUIUtility.singleLineHeight; Rect rect = GUILayoutUtility.GetRect(singleLineHeight, singleLineHeight, new GUILayoutOption[] { GUILayout.ExpandWidth(false) }); GUI.DrawTexture(rect, image); EditorGUILayout.LabelField(label, new GUILayoutOption[0]); EditorGUILayout.EndHorizontal(); EditorGUI.BeginDisabledGroup(this.m_InPlayMode); bool flag = EditorGUILayout.ButtonMouseDown(content, FocusType.Passive, EditorStyles.miniButton, new GUILayoutOption[0]); EditorGUI.EndDisabledGroup(); if (flag) { this.HandleButtonPress(); } }
private void ConnectionStateGUI() { Texture2D textured; GUIContent content; GUIContent content2; if (s_ConnectedTexture == null) { s_ConnectedTexture = EditorGUIUtility.LoadIconRequired("sv_icon_dot3_sml"); s_ConnectingTexture = EditorGUIUtility.LoadIconRequired("sv_icon_dot4_sml"); s_DisconnectedTexture = EditorGUIUtility.LoadIconRequired("sv_icon_dot6_sml"); } switch (this.m_ConnectionState) { case HolographicStreamerConnectionState.Connecting: textured = s_ConnectingTexture; content = s_ConnectionStateConnectingText; content2 = s_ConnectionButtonDisconnectText; break; case HolographicStreamerConnectionState.Connected: textured = s_ConnectedTexture; content = s_ConnectionStateConnectedText; content2 = s_ConnectionButtonDisconnectText; break; default: textured = s_DisconnectedTexture; content = s_ConnectionStateDisconnectedText; content2 = s_ConnectionButtonConnectText; break; } EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.PrefixLabel(s_ConnectionStatusText, "Button"); float singleLineHeight = EditorGUIUtility.singleLineHeight; GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(false) }; GUI.DrawTexture(GUILayoutUtility.GetRect(singleLineHeight, singleLineHeight, options), textured); EditorGUILayout.LabelField(content, new GUILayoutOption[0]); EditorGUILayout.EndHorizontal(); EditorGUI.BeginDisabledGroup(this.m_InPlayMode); bool flag = EditorGUILayout.ButtonMouseDown(content2, FocusType.Passive, EditorStyles.miniButton, new GUILayoutOption[0]); EditorGUI.EndDisabledGroup(); if (flag) { this.HandleButtonPress(); } }
private void DoGraphToolbar(Rect toolbarRect) { GUILayout.BeginArea(toolbarRect); GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); if (this.miniTool) { if (GUILayout.Button(AnimatorControllerTool.s_Styles.visibleOFF, AnimatorControllerTool.s_Styles.invisibleButton, new GUILayoutOption[0])) { this.miniTool = false; } GUILayout.Space(10f); } AnimatorControllerTool.BreadCrumbElement[] array = this.m_BreadCrumbs.ToArray(); for (int i = 0; i < array.Length; i++) { AnimatorControllerTool.BreadCrumbElement breadCrumbElement = array[i]; if (this.miniTool && i == 0) { if (EditorGUILayout.ButtonMouseDown(new GUIContent(breadCrumbElement.name), FocusType.Keyboard, EditorStyles.toolbarPopup, new GUILayoutOption[0])) { AnimatorControllerLayer[] layers = this.animatorController.layers; GenericMenu genericMenu = new GenericMenu(); for (int j = 0; j < layers.Length; j++) { genericMenu.AddItem(new GUIContent(layers[j].name), false, new GenericMenu.MenuFunction2(this.SetCurrentLayer), j); } genericMenu.AddSeparator(string.Empty); genericMenu.AddItem(new GUIContent("Create New Layer"), false, new GenericMenu.MenuFunction(this.AddNewLayer)); genericMenu.ShowAsContext(); } } else { EditorGUI.BeginChangeCheck(); GUILayout.Toggle(i == array.Length - 1, breadCrumbElement.name, (i != 0) ? AnimatorControllerTool.s_Styles.breadCrumbMid : AnimatorControllerTool.s_Styles.breadCrumbLeft, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { this.GoToBreadCrumbTarget(breadCrumbElement.target); } } } GUILayout.FlexibleSpace(); using (new EditorGUI.DisabledScope(this.animatorController == null)) { if (Unsupported.IsDeveloperBuild() && GUILayout.Button("Select Graph", EditorStyles.toolbarButton, new GUILayoutOption[0])) { if (this.m_BreadCrumbs.Last <AnimatorControllerTool.BreadCrumbElement>().target is AnimatorStateMachine) { Selection.activeObject = this.stateMachineGraph; } else { Selection.activeObject = this.blendTreeGraph; } } } AnimatorControllerTool.BreadCrumbElement breadCrumbElement2 = this.m_BreadCrumbs.LastOrDefault <AnimatorControllerTool.BreadCrumbElement>(); if (breadCrumbElement2 != null && breadCrumbElement2.target is AnimatorStateMachine) { this.m_AutoLiveLink = GUILayout.Toggle(this.m_AutoLiveLink, "Auto Live Link", EditorStyles.toolbarButton, new GUILayoutOption[0]); } GUILayout.EndHorizontal(); GUILayout.EndArea(); }