net.dreditor.subareas 0.1.6 → 0.1.8
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.SubAreas.asmdef +23 -23
- package/DREditor.SubAreas.asmdef.meta +7 -7
- package/ISubArea.cs +24 -24
- package/ISubArea.cs.meta +11 -11
- package/{Samples → Samples~}/InSubAreaActivation.asset +21 -21
- package/{Samples → Samples~}/InSubAreaActivation.asset.meta +8 -8
- package/{Samples → Samples~}/Sub_Area_Manager_Template.prefab +426 -426
- package/{Samples → Samples~}/Sub_Area_Manager_Template.prefab.meta +7 -7
- package/SubAreaActivationHandler.cs +182 -182
- package/SubAreaActivationHandler.cs.meta +11 -11
- package/SubAreaActivator.cs +389 -389
- package/SubAreaActivator.cs.meta +31 -31
- package/SubAreaData.cs +270 -270
- package/SubAreaData.cs.meta +11 -11
- package/SubAreaDeactivator.cs +349 -349
- package/SubAreaDeactivator.cs.meta +24 -24
- package/SubAreaManager.cs +190 -190
- package/SubAreaManager.cs.meta +19 -19
- package/SubAreaManagerBase.cs +109 -109
- package/SubAreaManagerBase.cs.meta +11 -11
- package/package.json +46 -41
- package/package.json.meta +7 -7
- package/Samples.meta +0 -8
package/SubAreaActivator.cs.meta
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 2830ffbba427d4947b566e18ff19e7c0
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences:
|
|
7
|
-
- currentDisplayName: {fileID: 11400000, guid: 88aacd5fe1fd23845940ecec407ac869,
|
|
8
|
-
type: 2}
|
|
9
|
-
- inDialogue: {fileID: 11400000, guid: b2839fc222ba4bc4eb8bcfee73b0c53d, type: 2}
|
|
10
|
-
- inTPFD: {fileID: 11400000, guid: 7f90df5202cae904292188e37c9076d3, type: 2}
|
|
11
|
-
- subAreaCollider: {instanceID: 0}
|
|
12
|
-
- tpfdManager: {instanceID: 0}
|
|
13
|
-
- objectGroup: {instanceID: 0}
|
|
14
|
-
- inLeaveProcess: {fileID: 11400000, guid: 787d287b8159b5049bbd73ee10c03b1b, type: 2}
|
|
15
|
-
- hasMenuAccess: {fileID: 11400000, guid: d969ff2ab7dd92342a1ac9ed2767ed51, type: 2}
|
|
16
|
-
- isLoadingFile: {fileID: 11400000, guid: 1d94fdc8796dc9f43b2a3bedb0f5d4dd, type: 2}
|
|
17
|
-
- deactivator: {instanceID: 0}
|
|
18
|
-
- focusedActor: {instanceID: 0}
|
|
19
|
-
- startDialogue: {instanceID: 0}
|
|
20
|
-
- autoStartDialogue: {instanceID: 0}
|
|
21
|
-
- cameraArrowsPrefab: {instanceID: 0}
|
|
22
|
-
- reticleCanSelect: {fileID: 11400000, guid: ecec9f55650b0ee45b50ef367dfdd81e, type: 2}
|
|
23
|
-
- OnSAMActivate: {fileID: 11400000, guid: d1672b728c996b242bb985f2e370b47f, type: 2}
|
|
24
|
-
- OnSAMAutoStartDialogue: {fileID: 11400000, guid: 93e905255c959894ca06259ee6211585,
|
|
25
|
-
type: 2}
|
|
26
|
-
- onFinishedRoomTransitions: {instanceID: 0}
|
|
27
|
-
executionOrder: 0
|
|
28
|
-
icon: {instanceID: 0}
|
|
29
|
-
userData:
|
|
30
|
-
assetBundleName:
|
|
31
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 2830ffbba427d4947b566e18ff19e7c0
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences:
|
|
7
|
+
- currentDisplayName: {fileID: 11400000, guid: 88aacd5fe1fd23845940ecec407ac869,
|
|
8
|
+
type: 2}
|
|
9
|
+
- inDialogue: {fileID: 11400000, guid: b2839fc222ba4bc4eb8bcfee73b0c53d, type: 2}
|
|
10
|
+
- inTPFD: {fileID: 11400000, guid: 7f90df5202cae904292188e37c9076d3, type: 2}
|
|
11
|
+
- subAreaCollider: {instanceID: 0}
|
|
12
|
+
- tpfdManager: {instanceID: 0}
|
|
13
|
+
- objectGroup: {instanceID: 0}
|
|
14
|
+
- inLeaveProcess: {fileID: 11400000, guid: 787d287b8159b5049bbd73ee10c03b1b, type: 2}
|
|
15
|
+
- hasMenuAccess: {fileID: 11400000, guid: d969ff2ab7dd92342a1ac9ed2767ed51, type: 2}
|
|
16
|
+
- isLoadingFile: {fileID: 11400000, guid: 1d94fdc8796dc9f43b2a3bedb0f5d4dd, type: 2}
|
|
17
|
+
- deactivator: {instanceID: 0}
|
|
18
|
+
- focusedActor: {instanceID: 0}
|
|
19
|
+
- startDialogue: {instanceID: 0}
|
|
20
|
+
- autoStartDialogue: {instanceID: 0}
|
|
21
|
+
- cameraArrowsPrefab: {instanceID: 0}
|
|
22
|
+
- reticleCanSelect: {fileID: 11400000, guid: ecec9f55650b0ee45b50ef367dfdd81e, type: 2}
|
|
23
|
+
- OnSAMActivate: {fileID: 11400000, guid: d1672b728c996b242bb985f2e370b47f, type: 2}
|
|
24
|
+
- OnSAMAutoStartDialogue: {fileID: 11400000, guid: 93e905255c959894ca06259ee6211585,
|
|
25
|
+
type: 2}
|
|
26
|
+
- onFinishedRoomTransitions: {instanceID: 0}
|
|
27
|
+
executionOrder: 0
|
|
28
|
+
icon: {instanceID: 0}
|
|
29
|
+
userData:
|
|
30
|
+
assetBundleName:
|
|
31
|
+
assetBundleVariant:
|
package/SubAreaData.cs
CHANGED
|
@@ -1,271 +1,271 @@
|
|
|
1
|
-
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
-
using DREditor.Cameras;
|
|
3
|
-
using DREditor.Dialogues;
|
|
4
|
-
using DREditor.Doors;
|
|
5
|
-
using System;
|
|
6
|
-
using UnityEngine;
|
|
7
|
-
|
|
8
|
-
namespace DREditor.SubAreas
|
|
9
|
-
{
|
|
10
|
-
/// <summary>
|
|
11
|
-
///
|
|
12
|
-
/// </summary>
|
|
13
|
-
[Serializable]
|
|
14
|
-
public class SubAreaData : IDialogueHolder
|
|
15
|
-
{
|
|
16
|
-
/// <summary>
|
|
17
|
-
///
|
|
18
|
-
/// </summary>
|
|
19
|
-
[Header("")]
|
|
20
|
-
[Space(10)]
|
|
21
|
-
|
|
22
|
-
[Header("")]
|
|
23
|
-
[Divider]
|
|
24
|
-
[Tooltip("")]
|
|
25
|
-
public string codeName = "";
|
|
26
|
-
|
|
27
|
-
/// <summary>
|
|
28
|
-
///
|
|
29
|
-
/// </summary>
|
|
30
|
-
[Tooltip("")]
|
|
31
|
-
public bool activated = false;
|
|
32
|
-
|
|
33
|
-
/// <summary>
|
|
34
|
-
///
|
|
35
|
-
/// </summary>
|
|
36
|
-
[Tooltip("")]
|
|
37
|
-
public bool finishedStart = false;
|
|
38
|
-
|
|
39
|
-
/// <summary>
|
|
40
|
-
///
|
|
41
|
-
/// </summary>
|
|
42
|
-
[Tooltip("")]
|
|
43
|
-
public bool finishedAuto = false;
|
|
44
|
-
|
|
45
|
-
/// <summary>
|
|
46
|
-
///
|
|
47
|
-
/// </summary>
|
|
48
|
-
[Tooltip("")]
|
|
49
|
-
public bool isWaiting = false;
|
|
50
|
-
|
|
51
|
-
/// <summary>
|
|
52
|
-
///
|
|
53
|
-
/// </summary>
|
|
54
|
-
[Tooltip("")]
|
|
55
|
-
public bool isWaitingAuto = false;
|
|
56
|
-
|
|
57
|
-
/// <summary>
|
|
58
|
-
///
|
|
59
|
-
/// </summary>
|
|
60
|
-
[Space(10)]
|
|
61
|
-
[Header("")]
|
|
62
|
-
[Divider]
|
|
63
|
-
[Tooltip("")]
|
|
64
|
-
public Vector3 returnPosition;
|
|
65
|
-
|
|
66
|
-
/// <summary>
|
|
67
|
-
///
|
|
68
|
-
/// </summary>
|
|
69
|
-
[Tooltip("")]
|
|
70
|
-
public Vector3 returnRotation;
|
|
71
|
-
|
|
72
|
-
/// <summary>
|
|
73
|
-
///
|
|
74
|
-
/// </summary>
|
|
75
|
-
[Tooltip("")]
|
|
76
|
-
public Vector2 returnAbs;
|
|
77
|
-
|
|
78
|
-
/// <summary>
|
|
79
|
-
///
|
|
80
|
-
/// </summary>
|
|
81
|
-
[Tooltip("")]
|
|
82
|
-
public Vector2 returnSmooth;
|
|
83
|
-
|
|
84
|
-
/// <summary>
|
|
85
|
-
///
|
|
86
|
-
/// </summary>
|
|
87
|
-
[Space(10)]
|
|
88
|
-
[Header("")]
|
|
89
|
-
[Divider]
|
|
90
|
-
[Tooltip("")]
|
|
91
|
-
public LockData enterData;
|
|
92
|
-
/// <summary>
|
|
93
|
-
///
|
|
94
|
-
/// </summary>
|
|
95
|
-
[Space(10)]
|
|
96
|
-
[Tooltip("")]
|
|
97
|
-
public LockData leaveData;
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
/// <summary>
|
|
101
|
-
///
|
|
102
|
-
/// </summary>
|
|
103
|
-
/// <param name="baseData"></param>
|
|
104
|
-
/// <param name="instanceData"></param>
|
|
105
|
-
/// <returns></returns>
|
|
106
|
-
public static SubAreaData MergeInstance(SubAreaData baseData, SubAreaData instanceData)
|
|
107
|
-
{
|
|
108
|
-
SubAreaData mergedData = (SubAreaData)instanceData.Clone();
|
|
109
|
-
|
|
110
|
-
mergedData.leaveData = (LockData)baseData.leaveData.Clone();
|
|
111
|
-
|
|
112
|
-
mergedData.enterData = (LockData)baseData.enterData.Clone();
|
|
113
|
-
|
|
114
|
-
return mergedData;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/// <summary>
|
|
118
|
-
///
|
|
119
|
-
/// </summary>
|
|
120
|
-
/// <returns></returns>
|
|
121
|
-
public virtual object Clone()
|
|
122
|
-
{
|
|
123
|
-
SubAreaData data = new()
|
|
124
|
-
{
|
|
125
|
-
codeName = codeName,
|
|
126
|
-
activated = activated,
|
|
127
|
-
finishedStart = finishedStart,
|
|
128
|
-
finishedAuto = finishedAuto,
|
|
129
|
-
isWaiting = isWaiting,
|
|
130
|
-
isWaitingAuto = isWaitingAuto,
|
|
131
|
-
returnPosition = returnPosition,
|
|
132
|
-
returnRotation = returnRotation,
|
|
133
|
-
returnAbs = returnAbs,
|
|
134
|
-
returnSmooth = returnSmooth,
|
|
135
|
-
leaveData = (LockData)leaveData.Clone(),
|
|
136
|
-
enterData = (LockData)enterData.Clone()
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
return data;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
/// <summary>
|
|
144
|
-
///
|
|
145
|
-
/// </summary>
|
|
146
|
-
/// <param name="codeName"></param>
|
|
147
|
-
/// <param name="leaveData"></param>
|
|
148
|
-
public virtual void SetIDLeaveData(string codeName, LockData leaveData)
|
|
149
|
-
{
|
|
150
|
-
this.codeName = codeName;
|
|
151
|
-
|
|
152
|
-
this.leaveData = leaveData;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/// <summary>
|
|
156
|
-
///
|
|
157
|
-
/// </summary>
|
|
158
|
-
/// <param name="activated"></param>
|
|
159
|
-
public virtual void SetActivated(bool activated) => this.activated = activated;
|
|
160
|
-
|
|
161
|
-
/// <summary>
|
|
162
|
-
///
|
|
163
|
-
/// </summary>
|
|
164
|
-
public virtual void FinishedStart()
|
|
165
|
-
{
|
|
166
|
-
finishedStart = true;
|
|
167
|
-
|
|
168
|
-
SetIsWaiting(false);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/// <summary>
|
|
172
|
-
///
|
|
173
|
-
/// </summary>
|
|
174
|
-
public virtual void FinishedAuto()
|
|
175
|
-
{
|
|
176
|
-
SetIsWaitingAuto(false);
|
|
177
|
-
|
|
178
|
-
finishedAuto = true;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/// <summary>
|
|
182
|
-
///
|
|
183
|
-
/// </summary>
|
|
184
|
-
/// <param name="isWaiting"></param>
|
|
185
|
-
public virtual void SetIsWaiting(bool isWaiting) => this.isWaiting = isWaiting;
|
|
186
|
-
|
|
187
|
-
/// <summary>
|
|
188
|
-
///
|
|
189
|
-
/// </summary>
|
|
190
|
-
/// <param name="isWaitingAuto"></param>
|
|
191
|
-
public virtual void SetIsWaitingAuto(bool isWaitingAuto) => this.isWaitingAuto = isWaitingAuto;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
/// <summary>
|
|
195
|
-
///
|
|
196
|
-
/// </summary>
|
|
197
|
-
/// <param name="cam"></param>
|
|
198
|
-
public virtual void SetReturnValues(UnityEngine.Camera cam)
|
|
199
|
-
{
|
|
200
|
-
returnPosition = cam.transform.position;
|
|
201
|
-
|
|
202
|
-
returnRotation = cam.transform.eulerAngles;
|
|
203
|
-
|
|
204
|
-
SmoothMouseLook mouse = cam.GetComponent<SmoothMouseLook>();
|
|
205
|
-
|
|
206
|
-
returnAbs = mouse.GetAbsolute();
|
|
207
|
-
|
|
208
|
-
returnSmooth = mouse.GetSmooth();
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
/// <summary>
|
|
212
|
-
///
|
|
213
|
-
/// </summary>
|
|
214
|
-
/// <returns></returns>
|
|
215
|
-
public virtual bool EnterMissingOrUnlocked() => !EnterDataValid() || !enterData.IsLocked();
|
|
216
|
-
|
|
217
|
-
/// <summary>
|
|
218
|
-
///
|
|
219
|
-
/// </summary>
|
|
220
|
-
/// <returns></returns>
|
|
221
|
-
public virtual bool EnterDataValid() =>
|
|
222
|
-
ReportElse(enterData != null, $"REPORT: {codeName}: Enter Data Not available");
|
|
223
|
-
|
|
224
|
-
/// <summary>
|
|
225
|
-
///
|
|
226
|
-
/// </summary>
|
|
227
|
-
/// <returns></returns>
|
|
228
|
-
public virtual bool EnteringPermanentlyLocked() =>
|
|
229
|
-
ReportIf(enterData.locked, $"REPORT: {codeName}: Enter Data is permanently Locked.");
|
|
230
|
-
|
|
231
|
-
/// <summary>
|
|
232
|
-
///
|
|
233
|
-
/// </summary>
|
|
234
|
-
/// <returns></returns>
|
|
235
|
-
public virtual bool EnteringUnlocked() =>
|
|
236
|
-
ReportElse(enterData.IsUnlocked(), $"REPORT: {codeName}: Enter Data has been Locked.");
|
|
237
|
-
|
|
238
|
-
/// <summary>
|
|
239
|
-
///
|
|
240
|
-
/// </summary>
|
|
241
|
-
/// <param name="condition"></param>
|
|
242
|
-
/// <param name="message"></param>
|
|
243
|
-
/// <returns></returns>
|
|
244
|
-
protected virtual bool ReportIf(bool condition, string message)
|
|
245
|
-
{
|
|
246
|
-
if (condition)
|
|
247
|
-
Debug.Log(message);
|
|
248
|
-
|
|
249
|
-
return condition;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
/// <summary>
|
|
253
|
-
///
|
|
254
|
-
/// </summary>
|
|
255
|
-
/// <param name="condition"></param>
|
|
256
|
-
/// <param name="message"></param>
|
|
257
|
-
/// <returns></returns>
|
|
258
|
-
protected virtual bool ReportElse(bool condition, string message)
|
|
259
|
-
{
|
|
260
|
-
if (!condition)
|
|
261
|
-
Debug.Log(message);
|
|
262
|
-
|
|
263
|
-
return condition;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/// <inheritdoc/>
|
|
267
|
-
public virtual bool CheckIfSaveDialogue() =>
|
|
268
|
-
(enterData is IDialogueHolder enter && enter.CheckIfSaveDialogue()) ||
|
|
269
|
-
(leaveData is IDialogueHolder leave && leave.CheckIfSaveDialogue());
|
|
270
|
-
}
|
|
1
|
+
//Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
|
|
2
|
+
using DREditor.Cameras;
|
|
3
|
+
using DREditor.Dialogues;
|
|
4
|
+
using DREditor.Doors;
|
|
5
|
+
using System;
|
|
6
|
+
using UnityEngine;
|
|
7
|
+
|
|
8
|
+
namespace DREditor.SubAreas
|
|
9
|
+
{
|
|
10
|
+
/// <summary>
|
|
11
|
+
///
|
|
12
|
+
/// </summary>
|
|
13
|
+
[Serializable]
|
|
14
|
+
public class SubAreaData : IDialogueHolder
|
|
15
|
+
{
|
|
16
|
+
/// <summary>
|
|
17
|
+
///
|
|
18
|
+
/// </summary>
|
|
19
|
+
[Header("")]
|
|
20
|
+
[Space(10)]
|
|
21
|
+
|
|
22
|
+
[Header("")]
|
|
23
|
+
[Divider]
|
|
24
|
+
[Tooltip("")]
|
|
25
|
+
public string codeName = "";
|
|
26
|
+
|
|
27
|
+
/// <summary>
|
|
28
|
+
///
|
|
29
|
+
/// </summary>
|
|
30
|
+
[Tooltip("")]
|
|
31
|
+
public bool activated = false;
|
|
32
|
+
|
|
33
|
+
/// <summary>
|
|
34
|
+
///
|
|
35
|
+
/// </summary>
|
|
36
|
+
[Tooltip("")]
|
|
37
|
+
public bool finishedStart = false;
|
|
38
|
+
|
|
39
|
+
/// <summary>
|
|
40
|
+
///
|
|
41
|
+
/// </summary>
|
|
42
|
+
[Tooltip("")]
|
|
43
|
+
public bool finishedAuto = false;
|
|
44
|
+
|
|
45
|
+
/// <summary>
|
|
46
|
+
///
|
|
47
|
+
/// </summary>
|
|
48
|
+
[Tooltip("")]
|
|
49
|
+
public bool isWaiting = false;
|
|
50
|
+
|
|
51
|
+
/// <summary>
|
|
52
|
+
///
|
|
53
|
+
/// </summary>
|
|
54
|
+
[Tooltip("")]
|
|
55
|
+
public bool isWaitingAuto = false;
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
///
|
|
59
|
+
/// </summary>
|
|
60
|
+
[Space(10)]
|
|
61
|
+
[Header("")]
|
|
62
|
+
[Divider]
|
|
63
|
+
[Tooltip("")]
|
|
64
|
+
public Vector3 returnPosition;
|
|
65
|
+
|
|
66
|
+
/// <summary>
|
|
67
|
+
///
|
|
68
|
+
/// </summary>
|
|
69
|
+
[Tooltip("")]
|
|
70
|
+
public Vector3 returnRotation;
|
|
71
|
+
|
|
72
|
+
/// <summary>
|
|
73
|
+
///
|
|
74
|
+
/// </summary>
|
|
75
|
+
[Tooltip("")]
|
|
76
|
+
public Vector2 returnAbs;
|
|
77
|
+
|
|
78
|
+
/// <summary>
|
|
79
|
+
///
|
|
80
|
+
/// </summary>
|
|
81
|
+
[Tooltip("")]
|
|
82
|
+
public Vector2 returnSmooth;
|
|
83
|
+
|
|
84
|
+
/// <summary>
|
|
85
|
+
///
|
|
86
|
+
/// </summary>
|
|
87
|
+
[Space(10)]
|
|
88
|
+
[Header("")]
|
|
89
|
+
[Divider]
|
|
90
|
+
[Tooltip("")]
|
|
91
|
+
public LockData enterData;
|
|
92
|
+
/// <summary>
|
|
93
|
+
///
|
|
94
|
+
/// </summary>
|
|
95
|
+
[Space(10)]
|
|
96
|
+
[Tooltip("")]
|
|
97
|
+
public LockData leaveData;
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
/// <summary>
|
|
101
|
+
///
|
|
102
|
+
/// </summary>
|
|
103
|
+
/// <param name="baseData"></param>
|
|
104
|
+
/// <param name="instanceData"></param>
|
|
105
|
+
/// <returns></returns>
|
|
106
|
+
public static SubAreaData MergeInstance(SubAreaData baseData, SubAreaData instanceData)
|
|
107
|
+
{
|
|
108
|
+
SubAreaData mergedData = (SubAreaData)instanceData.Clone();
|
|
109
|
+
|
|
110
|
+
mergedData.leaveData = (LockData)baseData.leaveData.Clone();
|
|
111
|
+
|
|
112
|
+
mergedData.enterData = (LockData)baseData.enterData.Clone();
|
|
113
|
+
|
|
114
|
+
return mergedData;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// <summary>
|
|
118
|
+
///
|
|
119
|
+
/// </summary>
|
|
120
|
+
/// <returns></returns>
|
|
121
|
+
public virtual object Clone()
|
|
122
|
+
{
|
|
123
|
+
SubAreaData data = new()
|
|
124
|
+
{
|
|
125
|
+
codeName = codeName,
|
|
126
|
+
activated = activated,
|
|
127
|
+
finishedStart = finishedStart,
|
|
128
|
+
finishedAuto = finishedAuto,
|
|
129
|
+
isWaiting = isWaiting,
|
|
130
|
+
isWaitingAuto = isWaitingAuto,
|
|
131
|
+
returnPosition = returnPosition,
|
|
132
|
+
returnRotation = returnRotation,
|
|
133
|
+
returnAbs = returnAbs,
|
|
134
|
+
returnSmooth = returnSmooth,
|
|
135
|
+
leaveData = (LockData)leaveData.Clone(),
|
|
136
|
+
enterData = (LockData)enterData.Clone()
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
return data;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
/// <summary>
|
|
144
|
+
///
|
|
145
|
+
/// </summary>
|
|
146
|
+
/// <param name="codeName"></param>
|
|
147
|
+
/// <param name="leaveData"></param>
|
|
148
|
+
public virtual void SetIDLeaveData(string codeName, LockData leaveData)
|
|
149
|
+
{
|
|
150
|
+
this.codeName = codeName;
|
|
151
|
+
|
|
152
|
+
this.leaveData = leaveData;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/// <summary>
|
|
156
|
+
///
|
|
157
|
+
/// </summary>
|
|
158
|
+
/// <param name="activated"></param>
|
|
159
|
+
public virtual void SetActivated(bool activated) => this.activated = activated;
|
|
160
|
+
|
|
161
|
+
/// <summary>
|
|
162
|
+
///
|
|
163
|
+
/// </summary>
|
|
164
|
+
public virtual void FinishedStart()
|
|
165
|
+
{
|
|
166
|
+
finishedStart = true;
|
|
167
|
+
|
|
168
|
+
SetIsWaiting(false);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/// <summary>
|
|
172
|
+
///
|
|
173
|
+
/// </summary>
|
|
174
|
+
public virtual void FinishedAuto()
|
|
175
|
+
{
|
|
176
|
+
SetIsWaitingAuto(false);
|
|
177
|
+
|
|
178
|
+
finishedAuto = true;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/// <summary>
|
|
182
|
+
///
|
|
183
|
+
/// </summary>
|
|
184
|
+
/// <param name="isWaiting"></param>
|
|
185
|
+
public virtual void SetIsWaiting(bool isWaiting) => this.isWaiting = isWaiting;
|
|
186
|
+
|
|
187
|
+
/// <summary>
|
|
188
|
+
///
|
|
189
|
+
/// </summary>
|
|
190
|
+
/// <param name="isWaitingAuto"></param>
|
|
191
|
+
public virtual void SetIsWaitingAuto(bool isWaitingAuto) => this.isWaitingAuto = isWaitingAuto;
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
/// <summary>
|
|
195
|
+
///
|
|
196
|
+
/// </summary>
|
|
197
|
+
/// <param name="cam"></param>
|
|
198
|
+
public virtual void SetReturnValues(UnityEngine.Camera cam)
|
|
199
|
+
{
|
|
200
|
+
returnPosition = cam.transform.position;
|
|
201
|
+
|
|
202
|
+
returnRotation = cam.transform.eulerAngles;
|
|
203
|
+
|
|
204
|
+
SmoothMouseLook mouse = cam.GetComponent<SmoothMouseLook>();
|
|
205
|
+
|
|
206
|
+
returnAbs = mouse.GetAbsolute();
|
|
207
|
+
|
|
208
|
+
returnSmooth = mouse.GetSmooth();
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/// <summary>
|
|
212
|
+
///
|
|
213
|
+
/// </summary>
|
|
214
|
+
/// <returns></returns>
|
|
215
|
+
public virtual bool EnterMissingOrUnlocked() => !EnterDataValid() || !enterData.IsLocked();
|
|
216
|
+
|
|
217
|
+
/// <summary>
|
|
218
|
+
///
|
|
219
|
+
/// </summary>
|
|
220
|
+
/// <returns></returns>
|
|
221
|
+
public virtual bool EnterDataValid() =>
|
|
222
|
+
ReportElse(enterData != null, $"REPORT: {codeName}: Enter Data Not available");
|
|
223
|
+
|
|
224
|
+
/// <summary>
|
|
225
|
+
///
|
|
226
|
+
/// </summary>
|
|
227
|
+
/// <returns></returns>
|
|
228
|
+
public virtual bool EnteringPermanentlyLocked() =>
|
|
229
|
+
ReportIf(enterData.locked, $"REPORT: {codeName}: Enter Data is permanently Locked.");
|
|
230
|
+
|
|
231
|
+
/// <summary>
|
|
232
|
+
///
|
|
233
|
+
/// </summary>
|
|
234
|
+
/// <returns></returns>
|
|
235
|
+
public virtual bool EnteringUnlocked() =>
|
|
236
|
+
ReportElse(enterData.IsUnlocked(), $"REPORT: {codeName}: Enter Data has been Locked.");
|
|
237
|
+
|
|
238
|
+
/// <summary>
|
|
239
|
+
///
|
|
240
|
+
/// </summary>
|
|
241
|
+
/// <param name="condition"></param>
|
|
242
|
+
/// <param name="message"></param>
|
|
243
|
+
/// <returns></returns>
|
|
244
|
+
protected virtual bool ReportIf(bool condition, string message)
|
|
245
|
+
{
|
|
246
|
+
if (condition)
|
|
247
|
+
Debug.Log(message);
|
|
248
|
+
|
|
249
|
+
return condition;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/// <summary>
|
|
253
|
+
///
|
|
254
|
+
/// </summary>
|
|
255
|
+
/// <param name="condition"></param>
|
|
256
|
+
/// <param name="message"></param>
|
|
257
|
+
/// <returns></returns>
|
|
258
|
+
protected virtual bool ReportElse(bool condition, string message)
|
|
259
|
+
{
|
|
260
|
+
if (!condition)
|
|
261
|
+
Debug.Log(message);
|
|
262
|
+
|
|
263
|
+
return condition;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/// <inheritdoc/>
|
|
267
|
+
public virtual bool CheckIfSaveDialogue() =>
|
|
268
|
+
(enterData is IDialogueHolder enter && enter.CheckIfSaveDialogue()) ||
|
|
269
|
+
(leaveData is IDialogueHolder leave && leave.CheckIfSaveDialogue());
|
|
270
|
+
}
|
|
271
271
|
}
|
package/SubAreaData.cs.meta
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 4426636232362dc43862bdba361356eb
|
|
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: 4426636232362dc43862bdba361356eb
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|