public override void OnInspectorGUI() { EditorGUILayout.LabelField("<color=#EE82EE>Dialog Source</color>", ResourcesManager.GetInstance.skin.GetStyle("Title")); GUILayout.Space(10); EditorGUILayout.HelpBox(((DialogObject)target)._description, MessageType.Info); GUILayout.Space(10); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Edit >>>", GUILayout.Height(40), GUILayout.Width(80))) { DialogEditorWindow.Open(); } if (GUILayout.Button("Value >>>", GUILayout.Height(40), GUILayout.Width(80))) { ValueManagerWindow.Open(); } EditorGUILayout.EndHorizontal(); GUILayout.Space(10); EditorGUILayout.LabelField("Archive Version: ", ((DialogObject)target)._saveVersion.ToString()); string path = Application.dataPath + "/../" + AssetDatabase.GetAssetPath(target); System.DateTime modifyDate = System.IO.File.GetLastAccessTime(path); EditorGUILayout.LabelField("Modify Date:", modifyDate.ToString("yyyy.MM.dd H:m:s")); }
public static void Open() { if (_instance != null) { _instance.Focus(); return; } _instance = EditorWindow.CreateInstance <ValueManagerWindow>(); _instance.titleContent = new GUIContent("Value Manager"); float h = 600; float w = 350; _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); GUIStyle style = ResourcesManager.GetInstance.skin.GetStyle("Title"); float btnW = 0; EditorGUI.LabelField(new Rect(btnW, 0, _windowRect.xMax, _titleHeight), new GUIContent(" Dialog Editor" + "->" + _dialogObject.name), style); GUIStyle buttonStyle = new GUIStyle(ResourcesManager.GetInstance.skin.button); if (GUI.Button(new Rect(_contentRect.width - 180, 3, 80, _titleHeight - 3), "Values", buttonStyle)) { ValueManagerWindow.Open(); } if (GUI.Button(new Rect(_contentRect.width - 90, 3, 80, _titleHeight - 3), "About", buttonStyle)) { About.ShowAbout(); } _dialogObject._debugMode = EditorGUI.ToggleLeft(new Rect(10f, _titleHeight, _windowRect.xMax, _titleHeight), "Debug Mode", _dialogObject._debugMode); //分割线 Handles.DrawLine(new Vector3(_windowRect.xMin, _windowRect.yMin + _topHeight - 2, 0), new Vector3(_windowRect.xMax, _windowRect.yMin + _topHeight - 2)); Handles.DrawLine(new Vector3(_windowRect.xMin, _windowRect.yMin + _topHeight, 0), new Vector3(_windowRect.xMax, _windowRect.yMin + _topHeight)); //运行时不允许存储加载 if (Application.isPlaying) { return; } buttonStyle.normal.textColor = new Color32(255, 64, 180, 255); if (GUI.Button(new Rect(_contentRect.width - 270, 3, 80, _titleHeight - 3), "Reload", buttonStyle)) { _dialogObject.Load(); } buttonStyle.normal.textColor = new Color32(0, 255, 0, 255); if (GUI.Button(new Rect(_contentRect.width - 360, 3, 80, _titleHeight - 3), "Save Dialog", buttonStyle)) { _dialogObject.Save(); } }