net.dreditor.spawnables 0.0.0-stage → 0.1.6
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.
- package/DREditor.Spawnables.asmdef +20 -0
- package/DREditor.Spawnables.asmdef.meta +7 -0
- package/ISaveable.cs +29 -0
- package/ISaveable.cs.meta +11 -0
- package/Implementation/Editor/SpawnConditionEditor.cs +217 -0
- package/Implementation/Editor/SpawnConditionEditor.cs.meta +11 -0
- package/Implementation/Editor.meta +8 -0
- package/Implementation/SpawnCondition.cs +132 -0
- package/Implementation/SpawnCondition.cs.meta +11 -0
- package/Implementation/VariableCapsule.cs +56 -0
- package/Implementation/VariableCapsule.cs.meta +11 -0
- package/Implementation.meta +8 -0
- package/Samples/SpawnCondition.prefab +57 -0
- package/Samples/SpawnCondition.prefab.meta +7 -0
- package/Samples.meta +8 -0
- package/Spawnable.cs +39 -0
- package/Spawnable.cs.meta +11 -0
- package/package.json +37 -6
- package/package.json.meta +7 -0
- package/README.md +0 -3
|
@@ -0,0 +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
|
|
20
|
+
}
|
package/ISaveable.cs
ADDED
|
@@ -0,0 +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
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
217
|
+
#endif
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Events;
|
|
4
|
+
using DREditor.EventObjects;
|
|
5
|
+
using DREditor.Progressing.Handling;
|
|
6
|
+
using DREditor.Services;
|
|
7
|
+
using UnityEngine;
|
|
8
|
+
|
|
9
|
+
namespace DREditor.Spawnables.Implementation
|
|
10
|
+
{
|
|
11
|
+
/// <summary>
|
|
12
|
+
///
|
|
13
|
+
/// </summary>
|
|
14
|
+
/// <remarks></remarks>
|
|
15
|
+
public class SpawnCondition : Spawnable, ISaveable, ISceneEventListener
|
|
16
|
+
{
|
|
17
|
+
public int SubID { get => subID; }
|
|
18
|
+
|
|
19
|
+
/// <summary>
|
|
20
|
+
///
|
|
21
|
+
/// </summary>
|
|
22
|
+
/// <remarks></remarks>
|
|
23
|
+
[SerializeField] protected int subID = 0;
|
|
24
|
+
|
|
25
|
+
/// <summary>
|
|
26
|
+
///
|
|
27
|
+
/// </summary>
|
|
28
|
+
public VariableCapsule InstanceData = new();
|
|
29
|
+
|
|
30
|
+
/// <summary>
|
|
31
|
+
///
|
|
32
|
+
/// </summary>
|
|
33
|
+
/// <remarks></remarks>
|
|
34
|
+
public SceneEvent sceneEvent = null;
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
/// <inheritdoc/>
|
|
38
|
+
protected override void OnEnable()
|
|
39
|
+
{
|
|
40
|
+
base.OnEnable();
|
|
41
|
+
|
|
42
|
+
sceneEvent.RegisterListener(this);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/// <inheritdoc/>
|
|
46
|
+
protected override void OnDisable()
|
|
47
|
+
{
|
|
48
|
+
base.OnDisable();
|
|
49
|
+
|
|
50
|
+
sceneEvent.UnregisterListener(this);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/// <summary>
|
|
54
|
+
///
|
|
55
|
+
/// </summary>
|
|
56
|
+
/// <remarks></remarks>
|
|
57
|
+
/// <param name="sceneEvent"></param>
|
|
58
|
+
public virtual void SetSceneEvent(SceneEvent sceneEvent) => this.sceneEvent = sceneEvent;
|
|
59
|
+
|
|
60
|
+
/// <summary>
|
|
61
|
+
///
|
|
62
|
+
/// </summary>
|
|
63
|
+
/// <param name="subID"></param>
|
|
64
|
+
public virtual void SetSubID(int subID) => this.subID = subID;
|
|
65
|
+
|
|
66
|
+
/// <summary>
|
|
67
|
+
///
|
|
68
|
+
/// </summary>
|
|
69
|
+
public virtual void OnEventRaised()
|
|
70
|
+
{
|
|
71
|
+
if (InstanceData.ignoreCondition)
|
|
72
|
+
UnityEngine.Debug.Log($"{gameObject.name}: Events Conditions for invoking have been set to be ignored.");
|
|
73
|
+
else if (AnyConditionsFailed())
|
|
74
|
+
return;
|
|
75
|
+
|
|
76
|
+
OnConditionPassed();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// <summary>
|
|
80
|
+
///
|
|
81
|
+
/// </summary>
|
|
82
|
+
/// <returns></returns>
|
|
83
|
+
protected virtual bool AnyConditionsFailed()
|
|
84
|
+
{
|
|
85
|
+
foreach (var variable in InstanceData.Conditions)
|
|
86
|
+
if (SpawnConditionFailed(variable))
|
|
87
|
+
return true;
|
|
88
|
+
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/// <summary>
|
|
93
|
+
///
|
|
94
|
+
/// </summary>
|
|
95
|
+
/// <param name="variable"></param>
|
|
96
|
+
/// <returns></returns>
|
|
97
|
+
protected virtual bool SpawnConditionFailed(VariableBase variable)
|
|
98
|
+
{
|
|
99
|
+
bool failed = !ServiceLocator.GetService<FlagTriggerHandlerBase>()
|
|
100
|
+
.EvaluateVariable(variable.Chapter, variable.Objective, variable.Flags, variable.FalseFlags);
|
|
101
|
+
|
|
102
|
+
if (failed)
|
|
103
|
+
UnityEngine.Debug.LogWarning($"{gameObject.name}: The Spawn Condition evaluated Failed.");
|
|
104
|
+
|
|
105
|
+
return failed;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// <summary>
|
|
109
|
+
///
|
|
110
|
+
/// </summary>
|
|
111
|
+
protected virtual void OnConditionPassed()
|
|
112
|
+
{
|
|
113
|
+
UnityEngine.Debug.Log($"{gameObject.name}: The Spawn Condition Variable Passed");
|
|
114
|
+
|
|
115
|
+
foreach (IDialogueEvent e in InstanceData.DiaEvents)
|
|
116
|
+
e.TriggerDialogueEvent();
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
/// <inheritdoc/>
|
|
121
|
+
public virtual string Save() => JsonUtility.ToJson(InstanceData, true);
|
|
122
|
+
|
|
123
|
+
/// <inheritdoc/>
|
|
124
|
+
public virtual void Load(string data)
|
|
125
|
+
{
|
|
126
|
+
InstanceData = JsonUtility.FromJson<VariableCapsule>(data);
|
|
127
|
+
|
|
128
|
+
if (Application.isPlaying && InstanceData != null && InstanceData.ignoreCondition)
|
|
129
|
+
OnEventRaised();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Dialogues;
|
|
3
|
+
using DREditor.Dialogues.Events;
|
|
4
|
+
using System.Collections.Generic;
|
|
5
|
+
using UnityEngine;
|
|
6
|
+
|
|
7
|
+
namespace DREditor.Spawnables.Implementation
|
|
8
|
+
{
|
|
9
|
+
/// <summary>
|
|
10
|
+
///
|
|
11
|
+
/// </summary>
|
|
12
|
+
[System.Serializable]
|
|
13
|
+
public class VariableCapsule
|
|
14
|
+
{
|
|
15
|
+
/// <summary>
|
|
16
|
+
///
|
|
17
|
+
/// </summary>
|
|
18
|
+
/// <remarks></remarks>
|
|
19
|
+
public bool ignoreCondition = false;
|
|
20
|
+
|
|
21
|
+
/// <summary>
|
|
22
|
+
///
|
|
23
|
+
/// </summary>
|
|
24
|
+
public bool showDiaEvents = false;
|
|
25
|
+
|
|
26
|
+
/// <summary>
|
|
27
|
+
///
|
|
28
|
+
/// </summary>
|
|
29
|
+
public List<VariableBase> Conditions = new();
|
|
30
|
+
|
|
31
|
+
/// <summary>
|
|
32
|
+
///
|
|
33
|
+
/// </summary>
|
|
34
|
+
[SerializeReference]
|
|
35
|
+
public List<IDialogueEvent> DiaEvents = new();
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
///
|
|
40
|
+
/// </summary>
|
|
41
|
+
/// <param name="ignoreCondition"></param>
|
|
42
|
+
public virtual void SetIgnoreCondition(bool ignoreCondition) => this.ignoreCondition = ignoreCondition;
|
|
43
|
+
|
|
44
|
+
/// <summary>
|
|
45
|
+
///
|
|
46
|
+
/// </summary>
|
|
47
|
+
/// <param name="showDiaEvents"></param>
|
|
48
|
+
public virtual void SetShowDialogueEvents(bool showDiaEvents) => this.showDiaEvents = showDiaEvents;
|
|
49
|
+
|
|
50
|
+
/// <summary>
|
|
51
|
+
///
|
|
52
|
+
/// </summary>
|
|
53
|
+
/// <param name="DiaEvents"></param>
|
|
54
|
+
public virtual void SetDialogueEvents(List<IDialogueEvent> DiaEvents) => this.DiaEvents = DiaEvents;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
%YAML 1.1
|
|
2
|
+
%TAG !u! tag:unity3d.com,2011:
|
|
3
|
+
--- !u!1 &7443237386743102024
|
|
4
|
+
GameObject:
|
|
5
|
+
m_ObjectHideFlags: 0
|
|
6
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
7
|
+
m_PrefabInstance: {fileID: 0}
|
|
8
|
+
m_PrefabAsset: {fileID: 0}
|
|
9
|
+
serializedVersion: 6
|
|
10
|
+
m_Component:
|
|
11
|
+
- component: {fileID: 6621964025476392394}
|
|
12
|
+
- component: {fileID: 8618034298458203337}
|
|
13
|
+
m_Layer: 0
|
|
14
|
+
m_Name: SpawnCondition
|
|
15
|
+
m_TagString: Untagged
|
|
16
|
+
m_Icon: {fileID: 0}
|
|
17
|
+
m_NavMeshLayer: 0
|
|
18
|
+
m_StaticEditorFlags: 0
|
|
19
|
+
m_IsActive: 1
|
|
20
|
+
--- !u!4 &6621964025476392394
|
|
21
|
+
Transform:
|
|
22
|
+
m_ObjectHideFlags: 0
|
|
23
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
24
|
+
m_PrefabInstance: {fileID: 0}
|
|
25
|
+
m_PrefabAsset: {fileID: 0}
|
|
26
|
+
m_GameObject: {fileID: 7443237386743102024}
|
|
27
|
+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
|
28
|
+
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
29
|
+
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
30
|
+
m_ConstrainProportionsScale: 0
|
|
31
|
+
m_Children: []
|
|
32
|
+
m_Father: {fileID: 0}
|
|
33
|
+
m_RootOrder: 0
|
|
34
|
+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
35
|
+
--- !u!114 &8618034298458203337
|
|
36
|
+
MonoBehaviour:
|
|
37
|
+
m_ObjectHideFlags: 0
|
|
38
|
+
m_CorrespondingSourceObject: {fileID: 0}
|
|
39
|
+
m_PrefabInstance: {fileID: 0}
|
|
40
|
+
m_PrefabAsset: {fileID: 0}
|
|
41
|
+
m_GameObject: {fileID: 7443237386743102024}
|
|
42
|
+
m_Enabled: 1
|
|
43
|
+
m_EditorHideFlags: 0
|
|
44
|
+
m_Script: {fileID: 11500000, guid: dc22b461c7cda4645983831d6ef62710, type: 3}
|
|
45
|
+
m_Name:
|
|
46
|
+
m_EditorClassIdentifier:
|
|
47
|
+
dialogueEventString:
|
|
48
|
+
subID: 0
|
|
49
|
+
InstanceData:
|
|
50
|
+
ignoreCondition: 0
|
|
51
|
+
showDiaEvents: 1
|
|
52
|
+
Conditions: []
|
|
53
|
+
DiaEvents: []
|
|
54
|
+
sceneEvent: {fileID: 11400000, guid: 7ae605a8b5a363040a5cedfe06a3040d, type: 2}
|
|
55
|
+
references:
|
|
56
|
+
version: 2
|
|
57
|
+
RefIds: []
|
package/Samples.meta
ADDED
package/Spawnable.cs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.DialogueEventHandling;
|
|
3
|
+
using UnityEngine;
|
|
4
|
+
|
|
5
|
+
namespace DREditor.Spawnables
|
|
6
|
+
{
|
|
7
|
+
/// <summary>
|
|
8
|
+
///
|
|
9
|
+
/// </summary>
|
|
10
|
+
/// <remarks></remarks>
|
|
11
|
+
public class Spawnable : DialogueEventHandler
|
|
12
|
+
{
|
|
13
|
+
/// <summary>
|
|
14
|
+
///
|
|
15
|
+
/// </summary>
|
|
16
|
+
protected override void OnEnable()
|
|
17
|
+
{
|
|
18
|
+
InitializeDestroyCall();
|
|
19
|
+
|
|
20
|
+
base.OnEnable();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/// <summary>
|
|
24
|
+
///
|
|
25
|
+
/// </summary>
|
|
26
|
+
[ContextMenu("Initialize Destroy Call")]
|
|
27
|
+
public virtual void InitializeDestroyCall()
|
|
28
|
+
{
|
|
29
|
+
if (dialogueEventString == "")
|
|
30
|
+
SetDefaultEventString("Destroy" + gameObject.name);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
///
|
|
35
|
+
/// </summary>
|
|
36
|
+
/// <param name="o"></param>
|
|
37
|
+
protected override void OnDialogueEventTriggered(object o = null) => Destroy(gameObject);
|
|
38
|
+
}
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "net.dreditor.spawnables",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "net.dreditor.spawnables",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"displayName": "DREditor Spawnables",
|
|
5
|
+
"description": "The beta for DREditor. A tool to create death game style projects without having to code.",
|
|
6
|
+
"unity": "6000.4",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"net.dreditor.core": "0.1.6",
|
|
9
|
+
"net.dreditor.dialogueeventhandling": "0.1.6",
|
|
10
|
+
"net.dreditor.progressing.handling": "0.1.6",
|
|
11
|
+
"net.dreditor.roomloading": "0.1.6"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Benjamin \"Sweden\" Jillson",
|
|
18
|
+
"email": "dreditortool@gmail.com",
|
|
19
|
+
"url": "https://dreditor.net"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"editor",
|
|
23
|
+
"tool",
|
|
24
|
+
"dreditor"
|
|
25
|
+
],
|
|
26
|
+
"samples": [
|
|
27
|
+
{
|
|
28
|
+
"displayName": "Samples",
|
|
29
|
+
"description": "",
|
|
30
|
+
"path": "Samples~"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"documentationUrl": "https://dreditor.net",
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"licensesUrl": "https://dreditor.net/docs/LICENSE.html",
|
|
36
|
+
"changelogUrl": "https://dreditor.net/docs/CHANGELOG.html"
|
|
37
|
+
}
|
package/README.md
DELETED