fr.jeanf.universal.player 0.8.5 → 0.8.6
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.
|
@@ -4,6 +4,8 @@ using jeanf.EventSystem;
|
|
|
4
4
|
using UnityEngine.Serialization;
|
|
5
5
|
using UnityEngine.Rendering;
|
|
6
6
|
using LitMotion;
|
|
7
|
+
using UnityEngine.Rendering.HighDefinition;
|
|
8
|
+
using Volume = UnityEngine.Rendering.Volume;
|
|
7
9
|
|
|
8
10
|
namespace jeanf.universalplayer
|
|
9
11
|
{
|
|
@@ -37,6 +39,7 @@ namespace jeanf.universalplayer
|
|
|
37
39
|
[SerializeField] private VolumeProfile URPVolumeProfile;
|
|
38
40
|
[SerializeField] private Volume postProcessVolume;
|
|
39
41
|
private static Volume staticPostProcessVolume;
|
|
42
|
+
private ColorAdjustments colorAdjustments;
|
|
40
43
|
|
|
41
44
|
private static MotionHandle _fadeHandle;
|
|
42
45
|
private static bool _isCurrentlyFading = false;
|
|
@@ -44,7 +47,10 @@ namespace jeanf.universalplayer
|
|
|
44
47
|
|
|
45
48
|
[Header("Listening On")]
|
|
46
49
|
[SerializeField] private BoolFloatEventChannelSO fadeOutChannelSO;
|
|
47
|
-
|
|
50
|
+
|
|
51
|
+
public delegate void TogglePPEDelegatte(bool state);
|
|
52
|
+
public static TogglePPEDelegatte TogglePPE;
|
|
53
|
+
|
|
48
54
|
|
|
49
55
|
private void Awake()
|
|
50
56
|
{
|
|
@@ -57,6 +63,10 @@ namespace jeanf.universalplayer
|
|
|
57
63
|
postProcessVolume.profile = URPVolumeProfile;
|
|
58
64
|
}
|
|
59
65
|
staticPostProcessVolume = postProcessVolume;
|
|
66
|
+
staticPostProcessVolume.profile.TryGet<ColorAdjustments>(out colorAdjustments);
|
|
67
|
+
colorAdjustments.colorFilter.value = Color.black;
|
|
68
|
+
colorAdjustments.saturation.value = 0;
|
|
69
|
+
|
|
60
70
|
FadeValue(false, .5f);
|
|
61
71
|
}
|
|
62
72
|
|
|
@@ -65,6 +75,7 @@ namespace jeanf.universalplayer
|
|
|
65
75
|
inputBinding.Enable();
|
|
66
76
|
inputBinding.performed += _ => SwitchFadeState();
|
|
67
77
|
fadeOutChannelSO.OnEventRaised += FadeValue;
|
|
78
|
+
TogglePPE += ChangePostProcessing;
|
|
68
79
|
}
|
|
69
80
|
|
|
70
81
|
private void OnDisable() => Unsubscribe();
|
|
@@ -77,6 +88,7 @@ namespace jeanf.universalplayer
|
|
|
77
88
|
fadeOutChannelSO.OnEventRaised -= FadeValue;
|
|
78
89
|
inputBinding.Disable();
|
|
79
90
|
DisableFadeHandle();
|
|
91
|
+
TogglePPE -= ChangePostProcessing;
|
|
80
92
|
}
|
|
81
93
|
|
|
82
94
|
private void Update()
|
|
@@ -90,7 +102,19 @@ namespace jeanf.universalplayer
|
|
|
90
102
|
_isFaded = !_isFaded;
|
|
91
103
|
FadeValue(_isFaded);
|
|
92
104
|
}
|
|
105
|
+
|
|
106
|
+
private void ChangePostProcessing(bool isInitComplete)
|
|
107
|
+
{
|
|
108
|
+
colorAdjustments.colorFilter.value = Color.black;
|
|
109
|
+
colorAdjustments.saturation.value = 0;
|
|
110
|
+
|
|
111
|
+
if(!isInitComplete)return;
|
|
112
|
+
|
|
113
|
+
colorAdjustments.colorFilter.value = Color.white;
|
|
114
|
+
colorAdjustments.saturation.value = -100;
|
|
115
|
+
}
|
|
93
116
|
|
|
117
|
+
|
|
94
118
|
public static void FadeValue(bool value)
|
|
95
119
|
{
|
|
96
120
|
FadeValue(value, _fadeTime);
|
|
@@ -35,10 +35,10 @@ MonoBehaviour:
|
|
|
35
35
|
m_Value: 0
|
|
36
36
|
colorFilter:
|
|
37
37
|
m_OverrideState: 1
|
|
38
|
-
m_Value: {r:
|
|
38
|
+
m_Value: {r: 1, g: 1, b: 1, a: 1}
|
|
39
39
|
hueShift:
|
|
40
40
|
m_OverrideState: 0
|
|
41
41
|
m_Value: 0
|
|
42
42
|
saturation:
|
|
43
|
-
m_OverrideState:
|
|
44
|
-
m_Value:
|
|
43
|
+
m_OverrideState: 1
|
|
44
|
+
m_Value: -100
|
package/package.json
CHANGED