protected void DrawGeneralProperties() { UIWindowID id = (UIWindowID)this.m_WindowIdProperty.enumValueIndex; EditorGUILayout.LabelField("General Properties", EditorStyles.boldLabel); EditorGUI.indentLevel = (EditorGUI.indentLevel + 1); EditorGUILayout.PropertyField(this.m_WindowIdProperty, new GUIContent("ID")); if (id == UIWindowID.Custom) { EditorGUILayout.PropertyField(this.m_CustomWindowIdProperty, new GUIContent("Custom ID")); } EditorGUI.BeginChangeCheck(); EditorGUILayout.PropertyField(this.m_StartingStateProperty, new GUIContent("Starting State")); if (EditorGUI.EndChangeCheck()) { foreach (Object target in this.targets) { (target as UIWindow).ApplyVisualState((UIWindow.VisualState) this.m_StartingStateProperty.enumValueIndex); } } EditorGUILayout.PropertyField(this.m_EscapeKeyActionProperty, new GUIContent("Escape Key Action")); EditorGUILayout.PropertyField(this.m_UseBlackOverlayProperty, new GUIContent("Use Black Overlay")); EditorGUI.indentLevel = (EditorGUI.indentLevel - 1); }
public static string getWindowName(UIWindowID id) { string name; windowPrefabPath.TryGetValue(id, out name); return(name); }
/// <summary> /// Focuses the window with the given ID. /// </summary> /// <param name="id">Identifier.</param> public static void FocusWindow(UIWindowID id) { // Focus the window if (UIWindow.GetWindow(id) != null) { UIWindow.GetWindow(id).Focus(); } }
/// <summary> /// Gets the window with the given ID. /// </summary> /// <returns>The window.</returns> /// <param name="id">Identifier.</param> public static UIWindow GetWindow(UIWindowID id) { // Get the windows and try finding the window with the given id foreach (UIWindow window in UIWindow.GetWindows()) { if (window.ID == id) { return(window); } } return(null); }
protected void DrawGeneralProperties() { UIWindowID id = (UIWindowID)this.m_WindowIdProperty.enumValueIndex; EditorGUILayout.LabelField("General Properties", EditorStyles.boldLabel); EditorGUI.indentLevel = (EditorGUI.indentLevel + 1); EditorGUILayout.PropertyField(this.m_WindowIdProperty, new GUIContent("ID")); if (id == UIWindowID.Custom) { EditorGUILayout.PropertyField(this.m_CustomWindowIdProperty, new GUIContent("Custom ID")); } EditorGUILayout.PropertyField(this.m_StartingStateProperty, new GUIContent("Starting State")); EditorGUILayout.PropertyField(this.m_EscapeKeyActionProperty, new GUIContent("Escape Key Action")); EditorGUI.indentLevel = (EditorGUI.indentLevel - 1); }