net.dreditor.doors 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.
Binary file
@@ -1,23 +1,23 @@
1
- {
2
- "name": "DREditor.Doors",
3
- "rootNamespace": "",
4
- "references": [
5
- "Unity.InputSystem",
6
- "DREditor",
7
- "DREditor.Input",
8
- "DREditor.Controls",
9
- "DREditor.LocalDialogues",
10
- "DREditor.Progressing.Handling",
11
- "DREditor.RoomLoading",
12
- "DREditor.Choices"
13
- ],
14
- "includePlatforms": [],
15
- "excludePlatforms": [],
16
- "allowUnsafeCode": false,
17
- "overrideReferences": false,
18
- "precompiledReferences": [],
19
- "autoReferenced": true,
20
- "defineConstraints": [],
21
- "versionDefines": [],
22
- "noEngineReferences": false
1
+ {
2
+ "name": "DREditor.Doors",
3
+ "rootNamespace": "",
4
+ "references": [
5
+ "Unity.InputSystem",
6
+ "DREditor",
7
+ "DREditor.Input",
8
+ "DREditor.Controls",
9
+ "DREditor.LocalDialogues",
10
+ "DREditor.Progressing.Handling",
11
+ "DREditor.RoomLoading",
12
+ "DREditor.Choices"
13
+ ],
14
+ "includePlatforms": [],
15
+ "excludePlatforms": [],
16
+ "allowUnsafeCode": false,
17
+ "overrideReferences": false,
18
+ "precompiledReferences": [],
19
+ "autoReferenced": true,
20
+ "defineConstraints": [],
21
+ "versionDefines": [],
22
+ "noEngineReferences": false
23
23
  }
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 3ee7ba857d8674540b50fc8ec0bad26e
3
- AssemblyDefinitionImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 3ee7ba857d8674540b50fc8ec0bad26e
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -1,30 +1,30 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues;
3
- using UnityEngine;
4
-
5
- namespace DREditor.Doors
6
- {
7
- /// <summary>
8
- ///
9
- /// </summary>
10
- [ClassHeader(nameof(LeaveAskManager) +
11
- "\n\n")]
12
- public class DialogueLeaveAskManager : LeaveAskManager
13
- {
14
- /// <summary>
15
- ///
16
- /// </summary>
17
- [Tooltip("")]
18
- [SerializeField] protected DialogueCore leaveAsk = null;
19
-
20
-
21
- /// <inheritdoc/>
22
- public override DialogueCore GetLeaveAskDialogue()
23
- {
24
- if (leaveAsk == null)
25
- UnityEngine.Debug.LogWarning("Leave Ask has not been added! please add it to the progression manager");
26
-
27
- return leaveAsk;
28
- }
29
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues;
3
+ using UnityEngine;
4
+
5
+ namespace DREditor.Doors
6
+ {
7
+ /// <summary>
8
+ ///
9
+ /// </summary>
10
+ [ClassHeader(nameof(LeaveAskManager) +
11
+ "\n\n")]
12
+ public class DialogueLeaveAskManager : LeaveAskManager
13
+ {
14
+ /// <summary>
15
+ ///
16
+ /// </summary>
17
+ [Tooltip("")]
18
+ [SerializeField] protected DialogueCore leaveAsk = null;
19
+
20
+
21
+ /// <inheritdoc/>
22
+ public override DialogueCore GetLeaveAskDialogue()
23
+ {
24
+ if (leaveAsk == null)
25
+ UnityEngine.Debug.LogWarning("Leave Ask has not been added! please add it to the progression manager");
26
+
27
+ return leaveAsk;
28
+ }
29
+ }
30
30
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: b3447c775421bee489cfab66c03b42a1
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: b3447c775421bee489cfab66c03b42a1
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
package/Door.cs CHANGED
@@ -1,191 +1,191 @@
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.Input;
6
- using DREditor.LocalDialogues;
7
- using DREditor.RoomLoading;
8
- using DREditor.Services;
9
- using UnityEngine;
10
- using static UnityEngine.InputSystem.InputAction;
11
-
12
- namespace DREditor.Doors
13
- {
14
- /// <summary>
15
- ///
16
- /// </summary>
17
- [ClassHeader(nameof(DoorBase) + ", " + nameof(IDoor) + ", " + nameof(IDialogueHolder) + ", " + nameof(ISelectableObject) + ", " +
18
- nameof(ISceneEventListener) +
19
- "\n\n")]
20
- public class Door : DoorBase, IDoor, IDialogueHolder, ISelectableObject, ISceneEventListener
21
- {
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- [Tooltip("")]
26
- [SerializeField] protected SceneEvent onFinishedLoadingRoom = null;
27
-
28
- /// <summary>
29
- ///
30
- /// </summary>
31
- [Tooltip("")]
32
- [SerializeField] protected BoolWithEvent changingObserve = null;
33
-
34
- /// <summary>
35
- ///
36
- /// </summary>
37
- [Tooltip("")]
38
- [SerializeField] protected BoolWithEvent inMenu = null;
39
-
40
- /// <summary>
41
- ///
42
- /// </summary>
43
- [Tooltip("")]
44
- [SerializeField] protected BoolWithEvent isLoadingToRoom = null;
45
-
46
- /// <summary>
47
- ///
48
- /// </summary>
49
- [Tooltip("")]
50
- [SerializeField] protected BoolWithEvent inDialogue = null;
51
-
52
- /// <summary>
53
- ///
54
- /// </summary>
55
- [Tooltip("")]
56
- [SerializeField] protected string leaveAskEvent = "OnLeaveAsk";
57
-
58
-
59
- /// <summary>
60
- ///
61
- /// </summary>
62
- protected override void Start()
63
- {
64
- if (isTPFD)
65
- onFinishedLoadingRoom.RegisterListener(this);
66
-
67
- base.Start();
68
- }
69
-
70
-
71
- /// <inheritdoc/>
72
- public virtual void OnEventRaised() => AddDoorControl();
73
-
74
- /// <inheritdoc/>
75
- public virtual void AddDoorControl()
76
- {
77
- onFinishedLoadingRoom.UnregisterListener(this);
78
-
79
- ServiceLocator.GetService<IInputManager>().GetLeave().performed += EvaluateLock;
80
- }
81
-
82
- /// <summary>
83
- ///
84
- /// </summary>
85
- protected virtual void OnDestroy() => RemoveDoorControl();
86
-
87
- /// <inheritdoc/>
88
- public virtual void RemoveDoorControl()
89
- {
90
- if (ServiceLocator.HasService<IInputManager>())
91
- ServiceLocator.GetService<IInputManager>().GetLeave().performed -= EvaluateLock;
92
- }
93
-
94
- /// <summary>
95
- ///
96
- /// </summary>
97
- protected virtual void EvaluateLock(CallbackContext context)
98
- {
99
- if (!inLeaveProcess.Value && !changingObserve.Value)
100
- LockCheck();
101
- }
102
-
103
- /// <summary>
104
- ///
105
- /// </summary>
106
- protected virtual void OnTriggerEnter(Collider other)
107
- {
108
- if (isHitbox && !inLeaveProcess.Value && !isLoadingToRoom.Value)
109
- LockCheck();
110
- }
111
-
112
- /// <inheritdoc/>
113
- public virtual void SelectObject() => LockCheck();
114
-
115
- /// <summary>
116
- ///
117
- /// </summary>
118
- protected virtual void LockCheck()
119
- {
120
- if (inMenu.Value || inDialogue.Value)
121
- return;
122
-
123
- inLeaveProcess.SetValue(true);
124
-
125
- if (isTPFD)
126
- DialogueEventSystem.TriggerEvent(leaveAskEvent);
127
-
128
- CheckLocks();
129
- }
130
-
131
-
132
- /// <inheritdoc/>
133
- public virtual void ClearLockData()
134
- {
135
- SetIdentified(true);
136
-
137
- data.ClearLockData();
138
- }
139
-
140
- /// <inheritdoc/>
141
- public virtual string GetGameObjectName() => gameObject.name;
142
-
143
- /// <inheritdoc/>
144
- public virtual bool IsTPFD() => isTPFD;
145
-
146
- /// <inheritdoc/>
147
- public virtual string GetDoorName() => ((DoorData)Save()).doorName;
148
-
149
- /// <inheritdoc/>
150
- public virtual string GetSaveDisplayName() => ((DoorData)Save()).displayName;
151
-
152
- /// <inheritdoc/>
153
- public virtual object Save()
154
- {
155
- data.SetName(gameObject.name);
156
-
157
- return (DoorData)data.Clone();
158
- }
159
-
160
- /// <inheritdoc/>
161
- public virtual void Load(object data)
162
- {
163
- this.data = (DoorData)data;
164
-
165
- SetIdentified(this.data.identified);
166
-
167
- CheckIfBeenThroughDoor();
168
- }
169
-
170
- /// <summary>
171
- ///
172
- /// </summary>
173
- /// <remarks></remarks>
174
- protected virtual void CheckIfBeenThroughDoor()
175
- {
176
- if (Application.isPlaying && setGateway != null)
177
- {
178
- bool beenThroughDoor = ServiceLocator.GetService<InstanceManagerBase>().ContainsRoomDataFor(setGateway.ToAreaName);
179
-
180
- if (beenThroughDoor && !data.identified)
181
- SetIdentified(beenThroughDoor);
182
- }
183
- }
184
-
185
-
186
- /// <inheritdoc/>
187
- public virtual bool CheckIfSaveDialogue()
188
- => data.lockData.lockDialogues.CheckIfSaveDialogue()
189
- || data.lockData.unlockedDialogues.CheckIfSaveDialogue();
190
- }
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.Input;
6
+ using DREditor.LocalDialogues;
7
+ using DREditor.RoomLoading;
8
+ using DREditor.Services;
9
+ using UnityEngine;
10
+ using static UnityEngine.InputSystem.InputAction;
11
+
12
+ namespace DREditor.Doors
13
+ {
14
+ /// <summary>
15
+ ///
16
+ /// </summary>
17
+ [ClassHeader(nameof(DoorBase) + ", " + nameof(IDoor) + ", " + nameof(IDialogueHolder) + ", " + nameof(ISelectableObject) + ", " +
18
+ nameof(ISceneEventListener) +
19
+ "\n\n")]
20
+ public class Door : DoorBase, IDoor, IDialogueHolder, ISelectableObject, ISceneEventListener
21
+ {
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Tooltip("")]
26
+ [SerializeField] protected SceneEvent onFinishedLoadingRoom = null;
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ [Tooltip("")]
32
+ [SerializeField] protected BoolWithEvent changingObserve = null;
33
+
34
+ /// <summary>
35
+ ///
36
+ /// </summary>
37
+ [Tooltip("")]
38
+ [SerializeField] protected BoolWithEvent inMenu = null;
39
+
40
+ /// <summary>
41
+ ///
42
+ /// </summary>
43
+ [Tooltip("")]
44
+ [SerializeField] protected BoolWithEvent isLoadingToRoom = null;
45
+
46
+ /// <summary>
47
+ ///
48
+ /// </summary>
49
+ [Tooltip("")]
50
+ [SerializeField] protected BoolWithEvent inDialogue = null;
51
+
52
+ /// <summary>
53
+ ///
54
+ /// </summary>
55
+ [Tooltip("")]
56
+ [SerializeField] protected string leaveAskEvent = "OnLeaveAsk";
57
+
58
+
59
+ /// <summary>
60
+ ///
61
+ /// </summary>
62
+ protected override void Start()
63
+ {
64
+ if (isTPFD)
65
+ onFinishedLoadingRoom.RegisterListener(this);
66
+
67
+ base.Start();
68
+ }
69
+
70
+
71
+ /// <inheritdoc/>
72
+ public virtual void OnEventRaised() => AddDoorControl();
73
+
74
+ /// <inheritdoc/>
75
+ public virtual void AddDoorControl()
76
+ {
77
+ onFinishedLoadingRoom.UnregisterListener(this);
78
+
79
+ ServiceLocator.GetService<IInputManager>().GetLeave().performed += EvaluateLock;
80
+ }
81
+
82
+ /// <summary>
83
+ ///
84
+ /// </summary>
85
+ protected virtual void OnDestroy() => RemoveDoorControl();
86
+
87
+ /// <inheritdoc/>
88
+ public virtual void RemoveDoorControl()
89
+ {
90
+ if (ServiceLocator.HasService<IInputManager>())
91
+ ServiceLocator.GetService<IInputManager>().GetLeave().performed -= EvaluateLock;
92
+ }
93
+
94
+ /// <summary>
95
+ ///
96
+ /// </summary>
97
+ protected virtual void EvaluateLock(CallbackContext context)
98
+ {
99
+ if (!inLeaveProcess.Value && !changingObserve.Value)
100
+ LockCheck();
101
+ }
102
+
103
+ /// <summary>
104
+ ///
105
+ /// </summary>
106
+ protected virtual void OnTriggerEnter(Collider other)
107
+ {
108
+ if (isHitbox && !inLeaveProcess.Value && !isLoadingToRoom.Value)
109
+ LockCheck();
110
+ }
111
+
112
+ /// <inheritdoc/>
113
+ public virtual void SelectObject() => LockCheck();
114
+
115
+ /// <summary>
116
+ ///
117
+ /// </summary>
118
+ protected virtual void LockCheck()
119
+ {
120
+ if (inMenu.Value || inDialogue.Value)
121
+ return;
122
+
123
+ inLeaveProcess.SetValue(true);
124
+
125
+ if (isTPFD)
126
+ DialogueEventSystem.TriggerEvent(leaveAskEvent);
127
+
128
+ CheckLocks();
129
+ }
130
+
131
+
132
+ /// <inheritdoc/>
133
+ public virtual void ClearLockData()
134
+ {
135
+ SetIdentified(true);
136
+
137
+ data.ClearLockData();
138
+ }
139
+
140
+ /// <inheritdoc/>
141
+ public virtual string GetGameObjectName() => gameObject.name;
142
+
143
+ /// <inheritdoc/>
144
+ public virtual bool IsTPFD() => isTPFD;
145
+
146
+ /// <inheritdoc/>
147
+ public virtual string GetDoorName() => ((DoorData)Save()).doorName;
148
+
149
+ /// <inheritdoc/>
150
+ public virtual string GetSaveDisplayName() => ((DoorData)Save()).displayName;
151
+
152
+ /// <inheritdoc/>
153
+ public virtual object Save()
154
+ {
155
+ data.SetName(gameObject.name);
156
+
157
+ return (DoorData)data.Clone();
158
+ }
159
+
160
+ /// <inheritdoc/>
161
+ public virtual void Load(object data)
162
+ {
163
+ this.data = (DoorData)data;
164
+
165
+ SetIdentified(this.data.identified);
166
+
167
+ CheckIfBeenThroughDoor();
168
+ }
169
+
170
+ /// <summary>
171
+ ///
172
+ /// </summary>
173
+ /// <remarks></remarks>
174
+ protected virtual void CheckIfBeenThroughDoor()
175
+ {
176
+ if (Application.isPlaying && setGateway != null)
177
+ {
178
+ bool beenThroughDoor = ServiceLocator.GetService<InstanceManagerBase>().ContainsRoomDataFor(setGateway.ToAreaName);
179
+
180
+ if (beenThroughDoor && !data.identified)
181
+ SetIdentified(beenThroughDoor);
182
+ }
183
+ }
184
+
185
+
186
+ /// <inheritdoc/>
187
+ public virtual bool CheckIfSaveDialogue()
188
+ => data.lockData.lockDialogues.CheckIfSaveDialogue()
189
+ || data.lockData.unlockedDialogues.CheckIfSaveDialogue();
190
+ }
191
191
  }
package/Door.cs.meta CHANGED
@@ -1,23 +1,23 @@
1
- fileFormatVersion: 2
2
- guid: 001586f9d1f2df74b95bb703ffe5308d
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences:
7
- - setGateway: {instanceID: 0}
8
- - inLeaveProcess: {fileID: 11400000, guid: 787d287b8159b5049bbd73ee10c03b1b, type: 2}
9
- - hasMenuAccess: {fileID: 11400000, guid: d969ff2ab7dd92342a1ac9ed2767ed51, type: 2}
10
- - currentControlsKey: {fileID: 11400000, guid: 076e48fabb7b9164f8f3255e13868b1a,
11
- type: 2}
12
- - checkOverlay: {fileID: 11400000, guid: 5cdcd237342722541999a1c2f9df856d, type: 2}
13
- - onFinishedLoadingRoom: {fileID: 11400000, guid: 7ae605a8b5a363040a5cedfe06a3040d,
14
- type: 2}
15
- - changingObserve: {fileID: 11400000, guid: bcc2f2368c3bcfc46ba4da22ee1674f1, type: 2}
16
- - inMenu: {fileID: 11400000, guid: ecf132a66f959974d84a1d2292242bdf, type: 2}
17
- - isLoadingToRoom: {fileID: 11400000, guid: 40489b01cccaf4f44b02b6d1b6ff4e8e, type: 2}
18
- - inDialogue: {fileID: 11400000, guid: b2839fc222ba4bc4eb8bcfee73b0c53d, type: 2}
19
- executionOrder: 0
20
- icon: {instanceID: 0}
21
- userData:
22
- assetBundleName:
23
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 001586f9d1f2df74b95bb703ffe5308d
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences:
7
+ - setGateway: {instanceID: 0}
8
+ - inLeaveProcess: {fileID: 11400000, guid: 787d287b8159b5049bbd73ee10c03b1b, type: 2}
9
+ - hasMenuAccess: {fileID: 11400000, guid: d969ff2ab7dd92342a1ac9ed2767ed51, type: 2}
10
+ - currentControlsKey: {fileID: 11400000, guid: 076e48fabb7b9164f8f3255e13868b1a,
11
+ type: 2}
12
+ - checkOverlay: {fileID: 11400000, guid: 5cdcd237342722541999a1c2f9df856d, type: 2}
13
+ - onFinishedLoadingRoom: {fileID: 11400000, guid: 7ae605a8b5a363040a5cedfe06a3040d,
14
+ type: 2}
15
+ - changingObserve: {fileID: 11400000, guid: bcc2f2368c3bcfc46ba4da22ee1674f1, type: 2}
16
+ - inMenu: {fileID: 11400000, guid: ecf132a66f959974d84a1d2292242bdf, type: 2}
17
+ - isLoadingToRoom: {fileID: 11400000, guid: 40489b01cccaf4f44b02b6d1b6ff4e8e, type: 2}
18
+ - inDialogue: {fileID: 11400000, guid: b2839fc222ba4bc4eb8bcfee73b0c53d, type: 2}
19
+ executionOrder: 0
20
+ icon: {instanceID: 0}
21
+ userData:
22
+ assetBundleName:
23
+ assetBundleVariant: