net.dreditor.camerapostprocess 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.
Files changed (36) hide show
  1. package/.attestation.p7m +0 -0
  2. package/BlurCameraRenderManager.cs +213 -213
  3. package/BlurCameraRenderManager.cs.meta +11 -11
  4. package/BlurRenderQueueSettings.cs +28 -28
  5. package/BlurRenderQueueSettings.cs.meta +11 -11
  6. package/BlurSettingsHandler.cs +58 -58
  7. package/BlurSettingsHandler.cs.meta +11 -11
  8. package/BlurVisionEvent.cs +208 -208
  9. package/BlurVisionEvent.cs.meta +11 -11
  10. package/CameraPostProcessingExtentions.cs +44 -44
  11. package/CameraPostProcessingExtentions.cs.meta +11 -11
  12. package/DREditor.CameraPostProcess.asmdef +19 -19
  13. package/DREditor.CameraPostProcess.asmdef.meta +7 -7
  14. package/PostProcessChanger.cs +223 -223
  15. package/PostProcessChanger.cs.meta +11 -11
  16. package/PostProcessState.cs +66 -66
  17. package/PostProcessState.cs.meta +11 -11
  18. package/PostProcessingColorEventHandler.cs +172 -172
  19. package/PostProcessingColorEventHandler.cs.meta +11 -11
  20. package/{Samples → Samples~}/BlurRenderQueueSettings.asset +15 -15
  21. package/{Samples → Samples~}/BlurRenderQueueSettings.asset.meta +8 -8
  22. package/{Samples → Samples~}/Blur_Camera_Render_Manager.prefab +73 -73
  23. package/{Samples → Samples~}/Blur_Camera_Render_Manager.prefab.meta +7 -7
  24. package/{Samples → Samples~}/PostProcessState Blur Camera.asset +19 -19
  25. package/{Samples → Samples~}/PostProcessState Blur Camera.asset.meta +8 -8
  26. package/{Samples → Samples~}/PostProcessState Dialogue Camera.asset +19 -19
  27. package/{Samples → Samples~}/PostProcessState Dialogue Camera.asset.meta +8 -8
  28. package/{Samples → Samples~}/PostProcessState Main Camera.asset +19 -19
  29. package/{Samples → Samples~}/PostProcessState Main Camera.asset.meta +8 -8
  30. package/{Samples → Samples~}/PostProcessState Protag Camera.asset +19 -19
  31. package/{Samples → Samples~}/PostProcessState Protag Camera.asset.meta +8 -8
  32. package/package.json +42 -37
  33. package/package.json.meta +7 -7
  34. package/readme.txt +22 -22
  35. package/readme.txt.meta +7 -7
  36. package/Samples.meta +0 -8
@@ -1,224 +1,224 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using DREditor.Dialogues.Events;
3
- using DREditor.EventObjects;
4
- using System.Collections;
5
- using System.Collections.Generic;
6
- using System.Linq;
7
- using UnityEngine.Rendering;
8
- using UnityEngine;
9
-
10
- #if UNITY_EDITOR
11
-
12
- using DREditor.Editor.Utility;
13
-
14
- #endif
15
-
16
- namespace DREditor.CamerasPostProcess
17
- {
18
- /// <summary>
19
- ///
20
- /// </summary>
21
- [ClassHeader("")]
22
- public class PostProcessChanger : MonoBehaviour
23
- {
24
- /// <summary>
25
- ///
26
- /// </summary>
27
- [Header("")]
28
- [Divider]
29
- [Tooltip("")]
30
- [SerializeField] protected string setHSVEventString = "SetHSV";
31
-
32
- /// <summary>
33
- ///
34
- /// </summary>
35
- [Tooltip("")]
36
- [SerializeField] protected string captureFreezeFrameEventString = "CaptureMain";
37
-
38
- /// <summary>
39
- ///
40
- /// </summary>
41
- [Tooltip("")]
42
- [SerializeField] protected string captureProtagFreezeFrameEventString = "CaptureProtag";
43
-
44
- /// <summary>
45
- ///
46
- /// </summary>
47
- [Tooltip("")]
48
- [SerializeField] protected string destroyCommandEventString = "DestroyPostProcess";
49
-
50
-
51
- /// <summary>
52
- ///
53
- /// </summary>
54
- [Header("")]
55
- [Divider]
56
- [Tooltip("")]
57
- [SerializeField] protected BoolWithEvent inDialogue = null;
58
-
59
- /// <summary>
60
- ///
61
- /// </summary>
62
- [Tooltip("")]
63
- [SerializeField] protected Color setHSVColor = new(0.2784314f, 0.2784314f, 0.2784314f, 1);
64
-
65
- /// <summary>
66
- ///
67
- /// </summary>
68
- [Tooltip("")]
69
- [SerializeField] protected List<PostProcessState> setStates = new();
70
-
71
-
72
- /// <summary>
73
- ///
74
- /// </summary>
75
- protected readonly List<PostProcessState> originalStates = new();
76
-
77
- /// <summary>
78
- ///
79
- /// </summary>
80
- protected List<UnityEngine.Camera> cameras = new();
81
-
82
-
83
- /// <summary>
84
- ///
85
- /// </summary>
86
- protected virtual void OnEnable()
87
- {
88
- InitializeOriginalStates();
89
-
90
- ApplyStateList(setStates);
91
-
92
- UpdateUI();
93
-
94
- DialogueEventSystem.StartListening(destroyCommandEventString, DestroyObject);
95
- }
96
-
97
- /// <summary>
98
- ///
99
- /// </summary>
100
- protected virtual void OnDisable()
101
- {
102
- ApplyStateList(originalStates);
103
-
104
- originalStates.Clear();
105
-
106
- DialogueEventSystem.StopListening(destroyCommandEventString, DestroyObject);
107
-
108
- DialogueEventSystem.TriggerEvent(destroyCommandEventString);
109
- }
110
-
111
- /// <summary>
112
- ///
113
- /// </summary>
114
- protected virtual void InitializeOriginalStates()
115
- {
116
- cameras = FindObjectsByType<UnityEngine.Camera>().ToList();
117
-
118
- foreach (var state in setStates)
119
- if (cameras.Find(camera => camera.gameObject.name == state.cameraObjectName) is UnityEngine.Camera found)
120
- originalStates.Add(ScriptableObject.CreateInstance<PostProcessState>().RecordState(found));
121
- }
122
-
123
- /// <summary>
124
- ///
125
- /// </summary>
126
- /// <param name="states"></param>
127
- protected virtual void ApplyStateList(List<PostProcessState> states)
128
- {
129
- if (cameras == null)
130
- return;
131
-
132
- foreach (var camera in cameras)
133
- if (camera != null && states.Find(state => state.cameraObjectName == camera.gameObject.name) is PostProcessState state)
134
- state.ApplyState(camera);
135
- else if (camera != null)
136
- UnityEngine.Debug.LogWarning("ALERT: Could not find state data for camera: " + camera.name);
137
- }
138
-
139
- /// <summary>
140
- ///
141
- /// </summary>
142
- protected virtual void UpdateUI()
143
- {
144
- DialogueEventSystem.TriggerEvent(setHSVEventString, setHSVColor);
145
-
146
- if (inDialogue.Value)
147
- ScreenshotCameras();
148
- }
149
-
150
- /// <summary>
151
- ///
152
- /// </summary>
153
- /// <remarks>
154
- ///
155
- /// </remarks>
156
- protected virtual void ScreenshotCameras()
157
- {
158
- DialogueEventSystem.TriggerEvent(captureFreezeFrameEventString, true);
159
-
160
- DialogueEventSystem.TriggerEvent(captureProtagFreezeFrameEventString);
161
- }
162
-
163
- /// <summary>
164
- ///
165
- /// </summary>
166
- /// <param name="o"></param>
167
- protected virtual void DestroyObject(object o) => StartCoroutine(DestroyMidDialogueRoutine());
168
-
169
- /// <summary>
170
- ///
171
- /// </summary>
172
- /// <returns></returns>
173
- protected virtual IEnumerator DestroyMidDialogueRoutine()
174
- {
175
- if (TryGetComponent(out Volume volume))
176
- Destroy(volume);
177
-
178
- yield return null;
179
-
180
- ScreenshotCameras();
181
-
182
- yield return null;
183
-
184
- Destroy(gameObject);
185
- }
186
-
187
-
188
- /// <summary>
189
- ///
190
- /// </summary>
191
- [ContextMenu("Set all States to True")]
192
- public void EnableAllSet()
193
- {
194
- foreach (var postProcessState in setStates)
195
- postProcessState.SetEnabled(true);
196
- }
197
-
198
- #if UNITY_EDITOR
199
-
200
- /// <summary>
201
- ///
202
- /// </summary>
203
- [ContextMenu("Create PostProcess Assets from all Cameras in Scene")]
204
- public void Scan()
205
- {
206
- UnityEngine.Debug.Log($"{ToString()}: Scans the scene for all cameras and creates PostProcessState assets for each.");
207
-
208
- var cameras = FindObjectsByType<UnityEngine.Camera>();
209
-
210
- setStates.Clear();
211
-
212
- foreach (var camera in cameras)
213
- {
214
- var state = CustomEditorUtility.CreateAsset<PostProcessState>("PostProcessState " + camera.gameObject.name);
215
-
216
- state = state.RecordState(camera);
217
-
218
- setStates.Add(state);
219
- }
220
- }
221
-
222
- #endif
223
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using DREditor.Dialogues.Events;
3
+ using DREditor.EventObjects;
4
+ using System.Collections;
5
+ using System.Collections.Generic;
6
+ using System.Linq;
7
+ using UnityEngine.Rendering;
8
+ using UnityEngine;
9
+
10
+ #if UNITY_EDITOR
11
+
12
+ using DREditor.Editor.Utility;
13
+
14
+ #endif
15
+
16
+ namespace DREditor.CamerasPostProcess
17
+ {
18
+ /// <summary>
19
+ ///
20
+ /// </summary>
21
+ [ClassHeader("")]
22
+ public class PostProcessChanger : MonoBehaviour
23
+ {
24
+ /// <summary>
25
+ ///
26
+ /// </summary>
27
+ [Header("")]
28
+ [Divider]
29
+ [Tooltip("")]
30
+ [SerializeField] protected string setHSVEventString = "SetHSV";
31
+
32
+ /// <summary>
33
+ ///
34
+ /// </summary>
35
+ [Tooltip("")]
36
+ [SerializeField] protected string captureFreezeFrameEventString = "CaptureMain";
37
+
38
+ /// <summary>
39
+ ///
40
+ /// </summary>
41
+ [Tooltip("")]
42
+ [SerializeField] protected string captureProtagFreezeFrameEventString = "CaptureProtag";
43
+
44
+ /// <summary>
45
+ ///
46
+ /// </summary>
47
+ [Tooltip("")]
48
+ [SerializeField] protected string destroyCommandEventString = "DestroyPostProcess";
49
+
50
+
51
+ /// <summary>
52
+ ///
53
+ /// </summary>
54
+ [Header("")]
55
+ [Divider]
56
+ [Tooltip("")]
57
+ [SerializeField] protected BoolWithEvent inDialogue = null;
58
+
59
+ /// <summary>
60
+ ///
61
+ /// </summary>
62
+ [Tooltip("")]
63
+ [SerializeField] protected Color setHSVColor = new(0.2784314f, 0.2784314f, 0.2784314f, 1);
64
+
65
+ /// <summary>
66
+ ///
67
+ /// </summary>
68
+ [Tooltip("")]
69
+ [SerializeField] protected List<PostProcessState> setStates = new();
70
+
71
+
72
+ /// <summary>
73
+ ///
74
+ /// </summary>
75
+ protected readonly List<PostProcessState> originalStates = new();
76
+
77
+ /// <summary>
78
+ ///
79
+ /// </summary>
80
+ protected List<UnityEngine.Camera> cameras = new();
81
+
82
+
83
+ /// <summary>
84
+ ///
85
+ /// </summary>
86
+ protected virtual void OnEnable()
87
+ {
88
+ InitializeOriginalStates();
89
+
90
+ ApplyStateList(setStates);
91
+
92
+ UpdateUI();
93
+
94
+ DialogueEventSystem.StartListening(destroyCommandEventString, DestroyObject);
95
+ }
96
+
97
+ /// <summary>
98
+ ///
99
+ /// </summary>
100
+ protected virtual void OnDisable()
101
+ {
102
+ ApplyStateList(originalStates);
103
+
104
+ originalStates.Clear();
105
+
106
+ DialogueEventSystem.StopListening(destroyCommandEventString, DestroyObject);
107
+
108
+ DialogueEventSystem.TriggerEvent(destroyCommandEventString);
109
+ }
110
+
111
+ /// <summary>
112
+ ///
113
+ /// </summary>
114
+ protected virtual void InitializeOriginalStates()
115
+ {
116
+ cameras = FindObjectsByType<UnityEngine.Camera>().ToList();
117
+
118
+ foreach (var state in setStates)
119
+ if (cameras.Find(camera => camera.gameObject.name == state.cameraObjectName) is UnityEngine.Camera found)
120
+ originalStates.Add(ScriptableObject.CreateInstance<PostProcessState>().RecordState(found));
121
+ }
122
+
123
+ /// <summary>
124
+ ///
125
+ /// </summary>
126
+ /// <param name="states"></param>
127
+ protected virtual void ApplyStateList(List<PostProcessState> states)
128
+ {
129
+ if (cameras == null)
130
+ return;
131
+
132
+ foreach (var camera in cameras)
133
+ if (camera != null && states.Find(state => state.cameraObjectName == camera.gameObject.name) is PostProcessState state)
134
+ state.ApplyState(camera);
135
+ else if (camera != null)
136
+ UnityEngine.Debug.LogWarning("ALERT: Could not find state data for camera: " + camera.name);
137
+ }
138
+
139
+ /// <summary>
140
+ ///
141
+ /// </summary>
142
+ protected virtual void UpdateUI()
143
+ {
144
+ DialogueEventSystem.TriggerEvent(setHSVEventString, setHSVColor);
145
+
146
+ if (inDialogue.Value)
147
+ ScreenshotCameras();
148
+ }
149
+
150
+ /// <summary>
151
+ ///
152
+ /// </summary>
153
+ /// <remarks>
154
+ ///
155
+ /// </remarks>
156
+ protected virtual void ScreenshotCameras()
157
+ {
158
+ DialogueEventSystem.TriggerEvent(captureFreezeFrameEventString, true);
159
+
160
+ DialogueEventSystem.TriggerEvent(captureProtagFreezeFrameEventString);
161
+ }
162
+
163
+ /// <summary>
164
+ ///
165
+ /// </summary>
166
+ /// <param name="o"></param>
167
+ protected virtual void DestroyObject(object o) => StartCoroutine(DestroyMidDialogueRoutine());
168
+
169
+ /// <summary>
170
+ ///
171
+ /// </summary>
172
+ /// <returns></returns>
173
+ protected virtual IEnumerator DestroyMidDialogueRoutine()
174
+ {
175
+ if (TryGetComponent(out Volume volume))
176
+ Destroy(volume);
177
+
178
+ yield return null;
179
+
180
+ ScreenshotCameras();
181
+
182
+ yield return null;
183
+
184
+ Destroy(gameObject);
185
+ }
186
+
187
+
188
+ /// <summary>
189
+ ///
190
+ /// </summary>
191
+ [ContextMenu("Set all States to True")]
192
+ public void EnableAllSet()
193
+ {
194
+ foreach (var postProcessState in setStates)
195
+ postProcessState.SetEnabled(true);
196
+ }
197
+
198
+ #if UNITY_EDITOR
199
+
200
+ /// <summary>
201
+ ///
202
+ /// </summary>
203
+ [ContextMenu("Create PostProcess Assets from all Cameras in Scene")]
204
+ public void Scan()
205
+ {
206
+ UnityEngine.Debug.Log($"{ToString()}: Scans the scene for all cameras and creates PostProcessState assets for each.");
207
+
208
+ var cameras = FindObjectsByType<UnityEngine.Camera>();
209
+
210
+ setStates.Clear();
211
+
212
+ foreach (var camera in cameras)
213
+ {
214
+ var state = CustomEditorUtility.CreateAsset<PostProcessState>("PostProcessState " + camera.gameObject.name);
215
+
216
+ state = state.RecordState(camera);
217
+
218
+ setStates.Add(state);
219
+ }
220
+ }
221
+
222
+ #endif
223
+ }
224
224
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: e0912bee5ce4950469a24641c4e39d6b
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: e0912bee5ce4950469a24641c4e39d6b
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,67 +1,67 @@
1
- //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
- using System;
3
- using UnityEngine;
4
- using UnityEngine.Serialization;
5
- using UnityEngine.Rendering.Universal;
6
-
7
- namespace DREditor.CamerasPostProcess
8
- {
9
- /// <summary>
10
- ///
11
- /// </summary>
12
- [Serializable]
13
- public class PostProcessState : ScriptableObject
14
- {
15
- /// <summary>
16
- ///
17
- /// </summary>
18
- [Header("")]
19
-
20
- [Tooltip("")]
21
- [FormerlySerializedAs("id")]
22
- public string cameraObjectName;
23
-
24
- /// <summary>
25
- ///
26
- /// </summary>
27
- [Tooltip("")]
28
- public LayerMask volumeMask;
29
-
30
- /// <summary>
31
- ///
32
- /// </summary>
33
- [Tooltip("")]
34
- public bool enabled;
35
-
36
-
37
- public PostProcessState() { }
38
-
39
- public virtual PostProcessState RecordState(UnityEngine.Camera camera)
40
- {
41
- cameraObjectName = camera.gameObject.name;
42
-
43
- enabled = camera.IsPostProcessingEnabled();
44
-
45
- volumeMask = camera.GetVolumeMask();
46
-
47
- return this;
48
- }
49
-
50
- /// <summary>
51
- ///
52
- /// </summary>
53
- /// <param name="enabled"></param>
54
- public virtual void SetEnabled(bool enabled) => this.enabled = enabled;
55
-
56
- /// <summary>
57
- ///
58
- /// </summary>
59
- /// <param name="camera"></param>
60
- public virtual void ApplyState(UnityEngine.Camera camera)
61
- {
62
- camera.SetPostProcessingTo(enabled);
63
-
64
- camera.GetUniversalAdditionalCameraData().volumeLayerMask = volumeMask;
65
- }
66
- }
1
+ //Author: Benjamin "Sweden" Jillson : Discord: sweden_gaming For Project Eden's Garden
2
+ using System;
3
+ using UnityEngine;
4
+ using UnityEngine.Serialization;
5
+ using UnityEngine.Rendering.Universal;
6
+
7
+ namespace DREditor.CamerasPostProcess
8
+ {
9
+ /// <summary>
10
+ ///
11
+ /// </summary>
12
+ [Serializable]
13
+ public class PostProcessState : ScriptableObject
14
+ {
15
+ /// <summary>
16
+ ///
17
+ /// </summary>
18
+ [Header("")]
19
+
20
+ [Tooltip("")]
21
+ [FormerlySerializedAs("id")]
22
+ public string cameraObjectName;
23
+
24
+ /// <summary>
25
+ ///
26
+ /// </summary>
27
+ [Tooltip("")]
28
+ public LayerMask volumeMask;
29
+
30
+ /// <summary>
31
+ ///
32
+ /// </summary>
33
+ [Tooltip("")]
34
+ public bool enabled;
35
+
36
+
37
+ public PostProcessState() { }
38
+
39
+ public virtual PostProcessState RecordState(UnityEngine.Camera camera)
40
+ {
41
+ cameraObjectName = camera.gameObject.name;
42
+
43
+ enabled = camera.IsPostProcessingEnabled();
44
+
45
+ volumeMask = camera.GetVolumeMask();
46
+
47
+ return this;
48
+ }
49
+
50
+ /// <summary>
51
+ ///
52
+ /// </summary>
53
+ /// <param name="enabled"></param>
54
+ public virtual void SetEnabled(bool enabled) => this.enabled = enabled;
55
+
56
+ /// <summary>
57
+ ///
58
+ /// </summary>
59
+ /// <param name="camera"></param>
60
+ public virtual void ApplyState(UnityEngine.Camera camera)
61
+ {
62
+ camera.SetPostProcessingTo(enabled);
63
+
64
+ camera.GetUniversalAdditionalCameraData().volumeLayerMask = volumeMask;
65
+ }
66
+ }
67
67
  }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: a5dea720cfe57204d9652d88c134e44c
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: a5dea720cfe57204d9652d88c134e44c
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: