net.dreditor.subareas 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.
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: b18d5f2806c35be4188d8a96589f5bc4
3
- PrefabImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: b18d5f2806c35be4188d8a96589f5bc4
3
+ PrefabImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
@@ -1,183 +1,183 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- #if DOTWEEN
3
- using DG.Tweening;
4
- #endif
5
- using DREditor.Doors;
6
- using DREditor.EventObjects;
7
- using DREditor.FPC;
8
- using DREditor.TwoPointFiveD;
9
- using System;
10
- using System.Collections;
11
- using System.Collections.Generic;
12
- using System.Linq;
13
- using UnityEngine;
14
-
15
- namespace DREditor.SubAreas
16
- {
17
- /// <summary>
18
- ///
19
- /// </summary>
20
- public abstract class SubAreaActivationHandler : SubAreaManagerBase
21
- {
22
- /// <summary>
23
- ///
24
- /// </summary>
25
- [Tooltip("")]
26
- [SerializeField] protected BoolWithEvent inLeaveProcess = null;
27
-
28
- /// <summary>
29
- ///
30
- /// </summary>
31
- [Tooltip("")]
32
- [SerializeField] protected BoolWithEvent hasMenuAccess = null;
33
-
34
- /// <summary>
35
- ///
36
- /// </summary>
37
- [Tooltip("")]
38
- [SerializeField] protected BoolWithEvent isLoadingFile = null;
39
-
40
-
41
- /// <summary>
42
- ///
43
- /// </summary>
44
- [Header("")]
45
- [Divider]
46
- [Tooltip("")]
47
- [SerializeField] protected BoxCollider subAreaCollider;
48
-
49
- /// <summary>
50
- ///
51
- /// </summary>
52
- [Tooltip("")]
53
- [SerializeField] protected TPFDManager tpfdManager = null;
54
-
55
- /// <summary>
56
- ///
57
- /// </summary>
58
- [Tooltip("")]
59
- [SerializeField] protected SelectableObjectGroup objectGroup = null;
60
-
61
-
62
- /// <summary>
63
- ///
64
- /// </summary>
65
- [Header("")]
66
- [Divider]
67
- [Tooltip("")]
68
- [SerializeField] protected bool TPFDMode = false;
69
-
70
- /// <summary>
71
- ///
72
- /// </summary>
73
- [Tooltip("")]
74
- [SerializeField] protected float panToBodyTime = 1;
75
-
76
- /// <summary>
77
- ///
78
- /// </summary>
79
- [Tooltip("")]
80
- [SerializeField] protected string mainCameraTag = "MainCamera";
81
-
82
-
83
- /// <summary>
84
- ///
85
- /// </summary>
86
- public event Action OnHandlerFinished;
87
-
88
-
89
- /// <summary>
90
- ///
91
- /// </summary>
92
- protected ControlMonobehaviours playerSystem;
93
-
94
- /// <summary>
95
- ///
96
- /// </summary>
97
- protected TPFDManager[] managers;
98
-
99
- /// <summary>
100
- ///
101
- /// </summary>
102
- protected UnityEngine.Camera mainCamera;
103
-
104
-
105
- /// <inheritdoc/>
106
- protected override void Awake()
107
- {
108
- if (AlreadyInTPFD())
109
- {
110
- tpfdManager.enabled = false;
111
-
112
- tpfdManager.InitializeTPFD();
113
- }
114
-
115
- base.Awake();
116
- }
117
-
118
- /// <summary>
119
- ///
120
- /// </summary>
121
- /// <returns></returns>
122
- protected virtual bool AlreadyInTPFD() => TPFDMode;
123
-
124
- /// <summary>
125
- ///
126
- /// </summary>
127
- protected virtual void Start()
128
- {
129
- mainCamera = GameObject.FindGameObjectWithTag(mainCameraTag).GetComponent<UnityEngine.Camera>();
130
-
131
- playerSystem = mainCamera.transform.root.GetComponent<ControlMonobehaviours>();
132
-
133
- managers = FindObjectsByType<TPFDManager>().Where(manager => manager.enabled).ToArray();
134
- }
135
-
136
-
137
- /// <summary>
138
- ///
139
- /// </summary>
140
- /// <param name="subAreaData"></param>
141
- public abstract void Initialize(object subAreaData);
142
-
143
- /// <summary>
144
- ///
145
- /// </summary>
146
- public abstract void BeginActivationState();
147
-
148
-
149
- /// <summary>
150
- ///
151
- /// </summary>
152
- /// <returns></returns>
153
- protected virtual List<IDoor> GetTPFDDoors()
154
- => FindObjectsByType<MonoBehaviour>().OfType<IDoor>().Where(door => door.IsTPFD()).ToList();
155
-
156
- /// <summary>
157
- ///
158
- /// </summary>
159
- /// <param name="position"></param>
160
- /// <param name="rotation"></param>
161
- /// <param name="duration"></param>
162
- /// <param name="bufferTime"></param>
163
- protected virtual IEnumerator MoveCameraToPosition(Vector3 position, Vector3 rotation, float duration, float bufferTime = 0)
164
- {
165
- #if DOTWEEN
166
- mainCamera.transform.DORotate(rotation, duration);
167
-
168
- mainCamera.transform.DOMove(position, duration);
169
- #endif
170
- yield return new WaitForSeconds(duration + bufferTime);
171
- }
172
-
173
- /// <summary>
174
- ///
175
- /// </summary>
176
- public abstract void EndOfActivationHandler();
177
-
178
- /// <summary>
179
- ///
180
- /// </summary>
181
- protected virtual void FinishHandler() => OnHandlerFinished?.Invoke();
182
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ #if DOTWEEN
3
+ using DG.Tweening;
4
+ #endif
5
+ using DREditor.Doors;
6
+ using DREditor.EventObjects;
7
+ using DREditor.FPC;
8
+ using DREditor.TwoPointFiveD;
9
+ using System;
10
+ using System.Collections;
11
+ using System.Collections.Generic;
12
+ using System.Linq;
13
+ using UnityEngine;
14
+
15
+ namespace DREditor.SubAreas
16
+ {
17
+ /// <summary>
18
+ ///
19
+ /// </summary>
20
+ public abstract class SubAreaActivationHandler : SubAreaManagerBase
21
+ {
22
+ /// <summary>
23
+ ///
24
+ /// </summary>
25
+ [Tooltip("")]
26
+ [SerializeField] protected BoolWithEvent inLeaveProcess = null;
27
+
28
+ /// <summary>
29
+ ///
30
+ /// </summary>
31
+ [Tooltip("")]
32
+ [SerializeField] protected BoolWithEvent hasMenuAccess = null;
33
+
34
+ /// <summary>
35
+ ///
36
+ /// </summary>
37
+ [Tooltip("")]
38
+ [SerializeField] protected BoolWithEvent isLoadingFile = null;
39
+
40
+
41
+ /// <summary>
42
+ ///
43
+ /// </summary>
44
+ [Header("")]
45
+ [Divider]
46
+ [Tooltip("")]
47
+ [SerializeField] protected BoxCollider subAreaCollider;
48
+
49
+ /// <summary>
50
+ ///
51
+ /// </summary>
52
+ [Tooltip("")]
53
+ [SerializeField] protected TPFDManager tpfdManager = null;
54
+
55
+ /// <summary>
56
+ ///
57
+ /// </summary>
58
+ [Tooltip("")]
59
+ [SerializeField] protected SelectableObjectGroup objectGroup = null;
60
+
61
+
62
+ /// <summary>
63
+ ///
64
+ /// </summary>
65
+ [Header("")]
66
+ [Divider]
67
+ [Tooltip("")]
68
+ [SerializeField] protected bool TPFDMode = false;
69
+
70
+ /// <summary>
71
+ ///
72
+ /// </summary>
73
+ [Tooltip("")]
74
+ [SerializeField] protected float panToBodyTime = 1;
75
+
76
+ /// <summary>
77
+ ///
78
+ /// </summary>
79
+ [Tooltip("")]
80
+ [SerializeField] protected string mainCameraTag = "MainCamera";
81
+
82
+
83
+ /// <summary>
84
+ ///
85
+ /// </summary>
86
+ public event Action OnHandlerFinished;
87
+
88
+
89
+ /// <summary>
90
+ ///
91
+ /// </summary>
92
+ protected ControlMonobehaviours playerSystem;
93
+
94
+ /// <summary>
95
+ ///
96
+ /// </summary>
97
+ protected TPFDManager[] managers;
98
+
99
+ /// <summary>
100
+ ///
101
+ /// </summary>
102
+ protected UnityEngine.Camera mainCamera;
103
+
104
+
105
+ /// <inheritdoc/>
106
+ protected override void Awake()
107
+ {
108
+ if (AlreadyInTPFD())
109
+ {
110
+ tpfdManager.enabled = false;
111
+
112
+ tpfdManager.InitializeTPFD();
113
+ }
114
+
115
+ base.Awake();
116
+ }
117
+
118
+ /// <summary>
119
+ ///
120
+ /// </summary>
121
+ /// <returns></returns>
122
+ protected virtual bool AlreadyInTPFD() => TPFDMode;
123
+
124
+ /// <summary>
125
+ ///
126
+ /// </summary>
127
+ protected virtual void Start()
128
+ {
129
+ mainCamera = GameObject.FindGameObjectWithTag(mainCameraTag).GetComponent<UnityEngine.Camera>();
130
+
131
+ playerSystem = mainCamera.transform.root.GetComponent<ControlMonobehaviours>();
132
+
133
+ managers = FindObjectsByType<TPFDManager>().Where(manager => manager.enabled).ToArray();
134
+ }
135
+
136
+
137
+ /// <summary>
138
+ ///
139
+ /// </summary>
140
+ /// <param name="subAreaData"></param>
141
+ public abstract void Initialize(object subAreaData);
142
+
143
+ /// <summary>
144
+ ///
145
+ /// </summary>
146
+ public abstract void BeginActivationState();
147
+
148
+
149
+ /// <summary>
150
+ ///
151
+ /// </summary>
152
+ /// <returns></returns>
153
+ protected virtual List<IDoor> GetTPFDDoors()
154
+ => FindObjectsByType<MonoBehaviour>().OfType<IDoor>().Where(door => door.IsTPFD()).ToList();
155
+
156
+ /// <summary>
157
+ ///
158
+ /// </summary>
159
+ /// <param name="position"></param>
160
+ /// <param name="rotation"></param>
161
+ /// <param name="duration"></param>
162
+ /// <param name="bufferTime"></param>
163
+ protected virtual IEnumerator MoveCameraToPosition(Vector3 position, Vector3 rotation, float duration, float bufferTime = 0)
164
+ {
165
+ #if DOTWEEN
166
+ mainCamera.transform.DORotate(rotation, duration);
167
+
168
+ mainCamera.transform.DOMove(position, duration);
169
+ #endif
170
+ yield return new WaitForSeconds(duration + bufferTime);
171
+ }
172
+
173
+ /// <summary>
174
+ ///
175
+ /// </summary>
176
+ public abstract void EndOfActivationHandler();
177
+
178
+ /// <summary>
179
+ ///
180
+ /// </summary>
181
+ protected virtual void FinishHandler() => OnHandlerFinished?.Invoke();
182
+ }
183
183
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 9d0f5c4e712244e4086849a834774837
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: 9d0f5c4e712244e4086849a834774837
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: