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.
- package/.attestation.p7m +0 -0
- package/DREditor.Spawnables.asmdef +19 -19
- package/DREditor.Spawnables.asmdef.meta +7 -7
- package/ISaveable.cs +28 -28
- package/ISaveable.cs.meta +11 -11
- package/Implementation/Editor/SpawnConditionEditor.cs +216 -216
- package/Implementation/Editor/SpawnConditionEditor.cs.meta +11 -11
- package/Implementation/Editor.meta +8 -8
- package/Implementation/SpawnCondition.cs +131 -131
- package/Implementation/SpawnCondition.cs.meta +11 -11
- package/Implementation/VariableCapsule.cs +55 -55
- package/Implementation/VariableCapsule.cs.meta +11 -11
- package/Implementation.meta +8 -8
- package/{Samples → Samples~}/SpawnCondition.prefab +57 -57
- package/{Samples → Samples~}/SpawnCondition.prefab.meta +7 -7
- package/Spawnable.cs +38 -38
- package/Spawnable.cs.meta +11 -11
- package/package.json +42 -37
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
|
@@ -1,132 +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
|
-
}
|
|
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
132
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: dc22b461c7cda4645983831d6ef62710
|
|
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: dc22b461c7cda4645983831d6ef62710
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
|
@@ -1,56 +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
|
-
}
|
|
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
56
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 85f79ee66aa14dc4995c120fa338e8e7
|
|
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: 85f79ee66aa14dc4995c120fa338e8e7
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|
package/Implementation.meta
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 0a8977b07ab2e7142babceaf3eb931de
|
|
3
|
-
folderAsset: yes
|
|
4
|
-
DefaultImporter:
|
|
5
|
-
externalObjects: {}
|
|
6
|
-
userData:
|
|
7
|
-
assetBundleName:
|
|
8
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 0a8977b07ab2e7142babceaf3eb931de
|
|
3
|
+
folderAsset: yes
|
|
4
|
+
DefaultImporter:
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
userData:
|
|
7
|
+
assetBundleName:
|
|
8
|
+
assetBundleVariant:
|
|
@@ -1,57 +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: []
|
|
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: []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: e18db2578139cac4896e1b278e9262d7
|
|
3
|
-
PrefabImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e18db2578139cac4896e1b278e9262d7
|
|
3
|
+
PrefabImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
package/Spawnable.cs
CHANGED
|
@@ -1,39 +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
|
-
}
|
|
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
39
|
}
|