VDE.cs
2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using VIDE_Data;
[CustomEditor(typeof(VD))]
public class VDE : Editor
{
Vector2 scrollPos = new Vector2();
public override bool RequiresConstantRepaint()
{
return true;
}
public override void OnInspectorGUI()
{
GUIStyle b = new GUIStyle(GUI.skin.GetStyle("Label"));
b.fontStyle = FontStyle.Bold;
if (EditorApplication.isPlaying)
{
if (VD.isActive)
{
GUILayout.Box("Active: " + VD.saved[VD.currentDiag].name, GUILayout.ExpandWidth(true));
}
else
{
GUILayout.Box("No dialogue Active", GUILayout.ExpandWidth(true));
}
scrollPos = EditorGUILayout.BeginScrollView(scrollPos, GUI.skin.GetStyle("Box"), GUILayout.ExpandWidth(true), GUILayout.Height(400));
for (int i = 0; i < VD.saved.Count; i++)
{
if (!VD.saved[i].loaded)
{
GUILayout.BeginHorizontal();
EditorGUILayout.LabelField(i.ToString() + ". " + VD.saved[i].name + ": NOT LOADED");
if (VD.isActive) GUI.enabled = false;
if (GUILayout.Button("Load!")) VD.LoadDialogues(VD.saved[i].name);
GUI.enabled = true;
GUILayout.EndHorizontal();
}
else
{
EditorGUILayout.LabelField(i.ToString() + ". " + VD.saved[i].name + ": LOADED", b);
}
}
EditorGUILayout.EndScrollView();
EditorGUILayout.BeginHorizontal();
if (VD.isActive) GUI.enabled = false;
if (GUILayout.Button("Load All"))
{
VD.LoadDialogues();
}
if (GUILayout.Button("Unload All"))
{
VD.UnloadDialogues();
}
GUI.enabled = true;
EditorGUILayout.EndHorizontal();
} else
{
GUILayout.Box("Enter PlayMode to display loaded/unloaded information", GUILayout.MaxWidth(300));
}
}
void OnInspectorUpdate()
{
Repaint();
}
}