public static void Open() { if (_instance != null) { _instance.Focus(); return; } _instance = EditorWindow.GetWindow<ValueManagerWindow>(); _instance.titleContent = new GUIContent("Value Manager"); float h = 600;// Screen.height * 0.8f; float w = 650;//Screen.width * 0.95f; _instance.position = new Rect(Screen.width - w, Screen.height - h, w, h); _instance.maxSize = new Vector2(w, Screen.height); _instance.Show(); }
private void ShowTitle() { EditorGUI.DrawTextureTransparent(new Rect(0, 0, position.width, _topHeight), ResourcesManager.GetInstance.texBackground); //EditorGUILayout.BeginHorizontal(); GUIStyle style = ResourcesManager.GetInstance.skin.GetStyle("Title"); float btnW = 0; if (EditMission != null) { btnW = 35; if (GUI.Button(new Rect(2, 3, btnW + 2, _titleHeight - 3), "<-", ResourcesManager.GetInstance.skin.button)) { EditMission = null; } } EditorGUI.LabelField(new Rect(btnW, 0, _windowRect.xMax, _titleHeight), new GUIContent(" Story Editor" + (_storyObject ? "->" + (EditMission == null ? _storyObject.name : _storyObject.name + " -> " + EditMission._name) : "")), style); GUIStyle buttonStyle = new GUIStyle(ResourcesManager.GetInstance.skin.button); if (GUI.Button(new Rect(_contentRect.width - 90, 3, 80, _titleHeight - 3), "Values", buttonStyle)) { ValueManagerWindow.Open(); } //运行时不允许存储加载 if (Application.isPlaying) { return; } buttonStyle.normal.textColor = new Color32(255, 64, 180, 255); if (GUI.Button(new Rect(_contentRect.width - 180, 3, 80, _titleHeight - 3), "Reload", buttonStyle)) { EditMission = null; _storyObject.Load(); } buttonStyle.normal.textColor = new Color32(0, 255, 0, 255); if (GUI.Button(new Rect(_contentRect.width - 270, 3, 80, _titleHeight - 3), "Save Story", buttonStyle)) { _storyObject.Save(); UnityEditor.EditorUtility.SetDirty(_storyObject); } //EditorGUILayout.EndHorizontal(); }
public static void Open() { if (_instance != null) { _instance.Focus(); return; } _instance = EditorWindow.GetWindow <ValueManagerWindow>(); _instance.titleContent = new GUIContent("Value Manager"); float h = 600; // Screen.height * 0.8f; float w = 650; //Screen.width * 0.95f; _instance.position = new Rect(Screen.width - w, Screen.height - h, w, h); _instance.maxSize = new Vector2(w, Screen.height); _instance.Show(); }