net.dreditor.spawnables 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -1,20 +1,20 @@
1
- {
2
- "name": "DREditor.Spawnables",
3
- "rootNamespace": "",
4
- "references": [
5
- "DREditor",
6
- "DREditor.DialogueEventHandling",
7
- "DREditor.Progressing.Handling",
8
- "DREditor.RoomLoading",
9
- "DREditor.Editor"
10
- ],
11
- "includePlatforms": [],
12
- "excludePlatforms": [],
13
- "allowUnsafeCode": false,
14
- "overrideReferences": false,
15
- "precompiledReferences": [],
16
- "autoReferenced": true,
17
- "defineConstraints": [],
18
- "versionDefines": [],
19
- "noEngineReferences": false
1
+ {
2
+ "name": "DREditor.Spawnables",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "DREditor",
6
+ "DREditor.DialogueEventHandling",
7
+ "DREditor.Progressing.Handling",
8
+ "DREditor.RoomLoading",
9
+ "DREditor.Editor"
10
+ ],
11
+ "includePlatforms": [],
12
+ "excludePlatforms": [],
13
+ "allowUnsafeCode": false,
14
+ "overrideReferences": false,
15
+ "precompiledReferences": [],
16
+ "autoReferenced": true,
17
+ "defineConstraints": [],
18
+ "versionDefines": [],
19
+ "noEngineReferences": false
20
20
  }
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 84197e5bac5a20a4bb0b57e7812c067d
3
- AssemblyDefinitionImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 84197e5bac5a20a4bb0b57e7812c067d
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/ISaveable.cs CHANGED
@@ -1,29 +1,29 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
-
3
- namespace DREditor.Spawnables
4
- {
5
- /// <summary>
6
- ///
7
- /// </summary>
8
- public interface ISaveable
9
- {
10
- /// <summary>
11
- ///
12
- /// </summary>
13
- /// <remarks></remarks>
14
- int SubID { get; }
15
-
16
-
17
- /// <summary>
18
- ///
19
- /// </summary>
20
- /// <returns></returns>
21
- string Save();
22
-
23
- /// <summary>
24
- ///
25
- /// </summary>
26
- /// <param name="data"></param>
27
- void Load(string data);
28
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+
3
+ namespace DREditor.Spawnables
4
+ {
5
+ /// <summary>
6
+ ///
7
+ /// </summary>
8
+ public interface ISaveable
9
+ {
10
+ /// <summary>
11
+ ///
12
+ /// </summary>
13
+ /// <remarks></remarks>
14
+ int SubID { get; }
15
+
16
+
17
+ /// <summary>
18
+ ///
19
+ /// </summary>
20
+ /// <returns></returns>
21
+ string Save();
22
+
23
+ /// <summary>
24
+ ///
25
+ /// </summary>
26
+ /// <param name="data"></param>
27
+ void Load(string data);
28
+ }
29
29
  }
package/ISaveable.cs.meta CHANGED
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 04d1d07fe90643e4a959b8fb6ec6742a
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 04d1d07fe90643e4a959b8fb6ec6742a
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,217 +1,217 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- #if UNITY_EDITOR
3
- using DREditor.Dialogues;
4
- using DREditor.Editor.Dialogues;
5
- using DREditor.Editor.Utility;
6
- using UnityEditor;
7
- using UnityEngine;
8
-
9
- namespace DREditor.Spawnables.Implementation.Editor
10
- {
11
- /// <summary>
12
- ///
13
- /// </summary>
14
- [CustomEditor(typeof(SpawnCondition))]
15
- public class SpawnConditionEditor : UnityEditor.Editor
16
- {
17
- /// <summary>
18
- ///
19
- /// </summary>
20
- protected VariableConditionEditor conditionEditor;
21
-
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- protected SpawnCondition spawnCondition;
26
-
27
- /// <summary>
28
- ///
29
- /// </summary>
30
- protected VariableCapsule conditionCapsule;
31
-
32
- /// <summary>
33
- ///
34
- /// </summary>
35
- protected DialogueEventEditor dialogueEventEditor;
36
-
37
- /// <summary>
38
- ///
39
- /// </summary>
40
- protected GUIStyle wrapStyle;
41
-
42
-
43
- /// <summary>
44
- ///
45
- /// </summary>
46
- protected virtual void OnEnable() => InitializeData();
47
-
48
- /// <summary>
49
- ///
50
- /// </summary>
51
- protected virtual void InitializeData()
52
- {
53
- spawnCondition = (SpawnCondition)target;
54
-
55
- conditionCapsule = spawnCondition.InstanceData;
56
-
57
- dialogueEventEditor = new(this, conditionCapsule.DiaEvents, conditionCapsule.showDiaEvents);
58
-
59
- conditionEditor = new();
60
- }
61
-
62
- /// <inheritdoc/>
63
- public override void OnInspectorGUI()
64
- {
65
- EditorGUI.BeginChangeCheck();
66
-
67
- CreateForm();
68
-
69
- if (EditorGUI.EndChangeCheck())
70
- {
71
- serializedObject.ApplyModifiedProperties();
72
-
73
- EditorUtility.SetDirty(spawnCondition);
74
- }
75
- }
76
-
77
- /// <summary>
78
- ///
79
- /// </summary>
80
- protected virtual void CreateForm()
81
- {
82
- InitializeWordWrappingStyle();
83
-
84
- DisplayScriptLabels();
85
-
86
- DisplayBasicFields();
87
-
88
- DisplayConditions();
89
-
90
- DisplayDialogueEvents();
91
- }
92
-
93
- /// <summary>
94
- ///
95
- /// </summary>
96
- protected virtual void InitializeWordWrappingStyle()
97
- {
98
- wrapStyle = new(GUI.skin.label)
99
- {
100
- wordWrap = true
101
- };
102
- }
103
-
104
- /// <summary>
105
- ///
106
- /// </summary>
107
- protected virtual void DisplayScriptLabels()
108
- {
109
- EditorGUILayout.LabelField("When a scene event invokes, evaluates players progression " +
110
- "and if the condition passes, triggers the dialogue events.",
111
- wrapStyle, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 20));
112
-
113
- EditorGUILayout.Space();
114
-
115
- EditorGUILayout.LabelField("Notice: Because this is Json serialized, Dialogue Events with scriptable objects won't " +
116
- "save unless they are turned into their own prefab.",
117
- wrapStyle, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 20));
118
-
119
- GUILayout.Space(10);
120
- }
121
-
122
- /// <summary>
123
- ///
124
- /// </summary>
125
- protected virtual void DisplayBasicFields()
126
- {
127
- spawnCondition.SetSubID(HandyFields.IntField(new GUIContent("Sub ID:", "The integer ID for this savable object. " +
128
- "If there is another of this scripts type their ID's should not be the same."), spawnCondition.SubID));
129
-
130
- EditorGUILayout.Space();
131
-
132
- spawnCondition.SetSceneEvent(HandyFields.UnityField(new GUIContent("Scene Event:",
133
- "The scene event to listen to in order to evaluate the condition. Usually on finished loading room."),
134
- spawnCondition.sceneEvent));
135
-
136
- EditorGUILayout.Space();
137
-
138
- conditionCapsule.SetIgnoreCondition(HandyFields.BoolField(conditionCapsule.ignoreCondition,
139
- new GUIContent("Ignore Condition, Just invoke events: ",
140
- "Whether the condition should not be evaluated and to instead just execute the dialogue." +
141
- "\nOriginally added to do Map UI Entry Spawns/Events for starts of FTE's.")));
142
-
143
- GUILayout.Space(10);
144
- }
145
-
146
- /// <summary>
147
- ///
148
- /// </summary>
149
- protected virtual void DisplayConditions()
150
- {
151
- using (new EditorGUILayout.VerticalScope("Box"))
152
- {
153
- GUIStyle boldStyle = new(EditorStyles.boldLabel);
154
-
155
- EditorGUILayout.LabelField(new GUIContent("Conditions",
156
- "The list of conditions required to be passed to invoke the dialogue events."), boldStyle);
157
-
158
- for (int i = 0; i < conditionCapsule.Conditions.Count; i++)
159
- {
160
- DisplayCondition(i);
161
-
162
- RemoveConditionButton(i);
163
- }
164
-
165
- AddConditionButton();
166
- }
167
- }
168
-
169
- /// <summary>
170
- ///
171
- /// </summary>
172
- /// <param name="i"></param>
173
- protected virtual void DisplayCondition(int i) =>
174
- conditionCapsule.Conditions[i] = conditionEditor.Display(conditionCapsule.Conditions[i]);
175
-
176
- /// <summary>
177
- ///
178
- /// </summary>
179
- protected virtual void AddConditionButton()
180
- {
181
- HandySplitters.UISplitter();
182
-
183
- HandyFields.AddItemButton(conditionCapsule.Conditions, "Condition", new VariableBase(), GUILayout.Width(130));
184
-
185
- HandySplitters.UISplitter();
186
- }
187
-
188
- /// <summary>
189
- ///
190
- /// </summary>
191
- /// <param name="conditionIndex"></param>
192
- protected virtual void RemoveConditionButton(int conditionIndex)
193
- {
194
- using (new EditorGUILayout.HorizontalScope())
195
- {
196
- GUILayout.Space(270);
197
-
198
- HandyFields.RemoveItemButton(conditionCapsule.Conditions, "Condition", conditionIndex, GUILayout.Width(130));
199
- }
200
- }
201
-
202
- /// <summary>
203
- ///
204
- /// </summary>
205
- protected virtual void DisplayDialogueEvents()
206
- {
207
- dialogueEventEditor.DisplayInterfaceInstances(serializedObject.FindProperty("InstanceData").FindPropertyRelative("DiaEvents"));
208
-
209
- conditionCapsule.SetShowDialogueEvents(dialogueEventEditor.showDiaEvents);
210
-
211
- conditionCapsule.SetDialogueEvents(dialogueEventEditor.instances);
212
-
213
- HandySplitters.UISplitter();
214
- }
215
- }
216
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if UNITY_EDITOR
3
+ using DREditor.Dialogues;
4
+ using DREditor.Editor.Dialogues;
5
+ using DREditor.Editor.Utility;
6
+ using UnityEditor;
7
+ using UnityEngine;
8
+
9
+ namespace DREditor.Spawnables.Implementation.Editor
10
+ {
11
+ /// <summary>
12
+ ///
13
+ /// </summary>
14
+ [CustomEditor(typeof(SpawnCondition))]
15
+ public class SpawnConditionEditor : UnityEditor.Editor
16
+ {
17
+ /// <summary>
18
+ ///
19
+ /// </summary>
20
+ protected VariableConditionEditor conditionEditor;
21
+
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ protected SpawnCondition spawnCondition;
26
+
27
+ /// <summary>
28
+ ///
29
+ /// </summary>
30
+ protected VariableCapsule conditionCapsule;
31
+
32
+ /// <summary>
33
+ ///
34
+ /// </summary>
35
+ protected DialogueEventEditor dialogueEventEditor;
36
+
37
+ /// <summary>
38
+ ///
39
+ /// </summary>
40
+ protected GUIStyle wrapStyle;
41
+
42
+
43
+ /// <summary>
44
+ ///
45
+ /// </summary>
46
+ protected virtual void OnEnable() => InitializeData();
47
+
48
+ /// <summary>
49
+ ///
50
+ /// </summary>
51
+ protected virtual void InitializeData()
52
+ {
53
+ spawnCondition = (SpawnCondition)target;
54
+
55
+ conditionCapsule = spawnCondition.InstanceData;
56
+
57
+ dialogueEventEditor = new(this, conditionCapsule.DiaEvents, conditionCapsule.showDiaEvents);
58
+
59
+ conditionEditor = new();
60
+ }
61
+
62
+ /// <inheritdoc/>
63
+ public override void OnInspectorGUI()
64
+ {
65
+ EditorGUI.BeginChangeCheck();
66
+
67
+ CreateForm();
68
+
69
+ if (EditorGUI.EndChangeCheck())
70
+ {
71
+ serializedObject.ApplyModifiedProperties();
72
+
73
+ EditorUtility.SetDirty(spawnCondition);
74
+ }
75
+ }
76
+
77
+ /// <summary>
78
+ ///
79
+ /// </summary>
80
+ protected virtual void CreateForm()
81
+ {
82
+ InitializeWordWrappingStyle();
83
+
84
+ DisplayScriptLabels();
85
+
86
+ DisplayBasicFields();
87
+
88
+ DisplayConditions();
89
+
90
+ DisplayDialogueEvents();
91
+ }
92
+
93
+ /// <summary>
94
+ ///
95
+ /// </summary>
96
+ protected virtual void InitializeWordWrappingStyle()
97
+ {
98
+ wrapStyle = new(GUI.skin.label)
99
+ {
100
+ wordWrap = true
101
+ };
102
+ }
103
+
104
+ /// <summary>
105
+ ///
106
+ /// </summary>
107
+ protected virtual void DisplayScriptLabels()
108
+ {
109
+ EditorGUILayout.LabelField("When a scene event invokes, evaluates players progression " +
110
+ "and if the condition passes, triggers the dialogue events.",
111
+ wrapStyle, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 20));
112
+
113
+ EditorGUILayout.Space();
114
+
115
+ EditorGUILayout.LabelField("Notice: Because this is Json serialized, Dialogue Events with scriptable objects won't " +
116
+ "save unless they are turned into their own prefab.",
117
+ wrapStyle, GUILayout.MaxWidth(EditorGUIUtility.currentViewWidth - 20));
118
+
119
+ GUILayout.Space(10);
120
+ }
121
+
122
+ /// <summary>
123
+ ///
124
+ /// </summary>
125
+ protected virtual void DisplayBasicFields()
126
+ {
127
+ spawnCondition.SetSubID(HandyFields.IntField(new GUIContent("Sub ID:", "The integer ID for this savable object. " +
128
+ "If there is another of this scripts type their ID's should not be the same."), spawnCondition.SubID));
129
+
130
+ EditorGUILayout.Space();
131
+
132
+ spawnCondition.SetSceneEvent(HandyFields.UnityField(new GUIContent("Scene Event:",
133
+ "The scene event to listen to in order to evaluate the condition. Usually on finished loading room."),
134
+ spawnCondition.sceneEvent));
135
+
136
+ EditorGUILayout.Space();
137
+
138
+ conditionCapsule.SetIgnoreCondition(HandyFields.BoolField(conditionCapsule.ignoreCondition,
139
+ new GUIContent("Ignore Condition, Just invoke events: ",
140
+ "Whether the condition should not be evaluated and to instead just execute the dialogue." +
141
+ "\nOriginally added to do Map UI Entry Spawns/Events for starts of FTE's.")));
142
+
143
+ GUILayout.Space(10);
144
+ }
145
+
146
+ /// <summary>
147
+ ///
148
+ /// </summary>
149
+ protected virtual void DisplayConditions()
150
+ {
151
+ using (new EditorGUILayout.VerticalScope("Box"))
152
+ {
153
+ GUIStyle boldStyle = new(EditorStyles.boldLabel);
154
+
155
+ EditorGUILayout.LabelField(new GUIContent("Conditions",
156
+ "The list of conditions required to be passed to invoke the dialogue events."), boldStyle);
157
+
158
+ for (int i = 0; i < conditionCapsule.Conditions.Count; i++)
159
+ {
160
+ DisplayCondition(i);
161
+
162
+ RemoveConditionButton(i);
163
+ }
164
+
165
+ AddConditionButton();
166
+ }
167
+ }
168
+
169
+ /// <summary>
170
+ ///
171
+ /// </summary>
172
+ /// <param name="i"></param>
173
+ protected virtual void DisplayCondition(int i) =>
174
+ conditionCapsule.Conditions[i] = conditionEditor.Display(conditionCapsule.Conditions[i]);
175
+
176
+ /// <summary>
177
+ ///
178
+ /// </summary>
179
+ protected virtual void AddConditionButton()
180
+ {
181
+ HandySplitters.UISplitter();
182
+
183
+ HandyFields.AddItemButton(conditionCapsule.Conditions, "Condition", new VariableBase(), GUILayout.Width(130));
184
+
185
+ HandySplitters.UISplitter();
186
+ }
187
+
188
+ /// <summary>
189
+ ///
190
+ /// </summary>
191
+ /// <param name="conditionIndex"></param>
192
+ protected virtual void RemoveConditionButton(int conditionIndex)
193
+ {
194
+ using (new EditorGUILayout.HorizontalScope())
195
+ {
196
+ GUILayout.Space(270);
197
+
198
+ HandyFields.RemoveItemButton(conditionCapsule.Conditions, "Condition", conditionIndex, GUILayout.Width(130));
199
+ }
200
+ }
201
+
202
+ /// <summary>
203
+ ///
204
+ /// </summary>
205
+ protected virtual void DisplayDialogueEvents()
206
+ {
207
+ dialogueEventEditor.DisplayInterfaceInstances(serializedObject.FindProperty("InstanceData").FindPropertyRelative("DiaEvents"));
208
+
209
+ conditionCapsule.SetShowDialogueEvents(dialogueEventEditor.showDiaEvents);
210
+
211
+ conditionCapsule.SetDialogueEvents(dialogueEventEditor.instances);
212
+
213
+ HandySplitters.UISplitter();
214
+ }
215
+ }
216
+ }
217
217
  #endif
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 9fe71e3eac3ab6a49b7ba512de7188a9
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 9fe71e3eac3ab6a49b7ba512de7188a9
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: a458e73099bab8b44ad204ab87736c2f
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: a458e73099bab8b44ad204ab87736c2f
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant: