public DialogLifeCycle(DialogGraph graph) { Init(graph); }
public override void DrawWindows() { base.DrawWindows(); #region Graph field Rect zone = new Rect(0, 0, 200, 100); EditorGUI.DrawRect(zone, settings.otherGUIColor); GUILayout.BeginArea(new Rect(zone.x + 2, zone.y + 2, zone.width, zone.height)); GetEGLLable("Dialog: ", GUIStylizer.GetStyle(GUIStylizer.Colors.WHITE, TextAnchor.MiddleLeft, 20)); currentGraph = (NodeGraph)EditorGUILayout.ObjectField(currentGraph, typeof(DialogGraph), false, GUILayout.Width(200)); // field to choose graph if (GUI.Button(new Rect(43, 50, 100, 20), "New graph")) { currentGraph = ScriptableObjectUtility.CreateAsset <DialogGraph>("NewDialogGraph"); } GUILayout.EndArea(); if (currentGraph == null) { GUILayout.BeginArea(new Rect(150, 300, 1920, 200)); GetEGLLable("No Dialog Assign!", GUIStylizer.GetStyle(GUIStylizer.Colors.RED, TextAnchor.MiddleLeft, 200, 0, 0, 130, 0f)); GUILayout.EndArea(); } #endregion if (currentGraph != null) { GUILayout.BeginArea(new Rect(205, 20, 150, 50)); GUILayout.BeginHorizontal(); showDialogSettings = GUILayout.Toggle(showDialogSettings, ""); GetEGLLable("Show settings", GUIStylizer.GetStyle(GUIStylizer.Colors.REDPING, TextAnchor.MiddleLeft, 15)); GUILayout.EndHorizontal(); GUILayout.EndArea(); if (showDialogSettings) { DialogGraph d = currentGraph as DialogGraph; Rect sett = new Rect(355, 10, 1500, 50); GUIStyle s = GUIStylizer.GetStyle(settings.otherGUIColor, TextAnchor.UpperCenter, 20, 0, 0, 10, 0f); EditorGUI.DrawRect(sett, settings.otherGUIColor); GUI.contentColor = Color.white; float spacing = -70; if (d.unlimitedRepeating) { spacing = -150; } if (d.repeatable) { spacing = 0; } GUILayout.BeginArea(sett, s); GUILayout.BeginHorizontal(); d.IsEnable = GUILayout.Toggle(d.IsEnable, ""); GUILayout.Space(spacing); GetEGLLable("Enable", GUIStylizer.GetStyle(GUIStylizer.Colors.WHITE, TextAnchor.MiddleLeft, 20)); d.unlimitedRepeating = GUILayout.Toggle(d.unlimitedRepeating, ""); GUILayout.Space(spacing); GetEGLLable("Unlimited Repeating", GUIStylizer.GetStyle(GUIStylizer.Colors.WHITE, TextAnchor.MiddleLeft, 20)); if (!d.unlimitedRepeating) { d.repeatable = GUILayout.Toggle(d.repeatable, ""); GUILayout.Space(spacing); GetEGLLable("Repeatable", GUIStylizer.GetStyle(GUIStylizer.Colors.WHITE, TextAnchor.MiddleLeft, 20)); if (d.repeatable) { GetEGLLable("Repeat Limit", GUIStylizer.GetStyle(GUIStylizer.Colors.WHITE, TextAnchor.MiddleLeft, 20)); GUILayout.Space(spacing); d.repeatLimit = EditorGUILayout.IntField(d.repeatLimit, ""); } } d.skipable = GUILayout.Toggle(d.skipable, ""); GUILayout.Space(spacing); GetEGLLable("Skipable", GUIStylizer.GetStyle(GUIStylizer.Colors.WHITE, TextAnchor.MiddleLeft, 20)); d.destroyOnEnd = GUILayout.Toggle(d.destroyOnEnd, ""); GUILayout.Space(spacing); GetEGLLable("Destroy On End", GUIStylizer.GetStyle(GUIStylizer.Colors.WHITE, TextAnchor.MiddleLeft, 20)); GUILayout.EndHorizontal(); GUILayout.EndArea(); } } }