diff --git a/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIDissolveEditor.cs b/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIDissolveEditor.cs index 1351f1bc..425c31b8 100644 --- a/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIDissolveEditor.cs +++ b/Assets/Coffee/UIExtensions/UIEffect/Scripts/Editor/UIDissolveEditor.cs @@ -36,6 +36,7 @@ protected override void OnEnable() _spColorMode = serializedObject.FindProperty("m_ColorMode"); _spNoiseTexture = serializedObject.FindProperty("m_NoiseTexture"); _spKeepAspectRatio = serializedObject.FindProperty("m_KeepAspectRatio"); + _spReverseAnimation = serializedObject.FindProperty("m_ReverseAnimation"); var player = serializedObject.FindProperty("m_Player"); _spPlay = player.FindPropertyRelative("play"); _spDuration = player.FindPropertyRelative("duration"); @@ -118,6 +119,7 @@ public override void OnInspectorGUI() EditorGUILayout.PropertyField(_spLoop); EditorGUILayout.PropertyField(_spLoopDelay); EditorGUILayout.PropertyField(_spUpdateMode); + EditorGUILayout.PropertyField(_spReverseAnimation); // Debug. using (new EditorGUI.DisabledGroupScope(!Application.isPlaying)) @@ -164,6 +166,7 @@ public override void OnInspectorGUI() SerializedProperty _spNoiseTexture; SerializedProperty _spEffectArea; SerializedProperty _spKeepAspectRatio; + SerializedProperty _spReverseAnimation; SerializedProperty _spPlay; SerializedProperty _spLoop; SerializedProperty _spLoopDelay; diff --git a/Assets/Coffee/UIExtensions/UIEffect/Scripts/UIDissolve.cs b/Assets/Coffee/UIExtensions/UIEffect/Scripts/UIDissolve.cs index 49e0a315..68af05ba 100644 --- a/Assets/Coffee/UIExtensions/UIEffect/Scripts/UIDissolve.cs +++ b/Assets/Coffee/UIExtensions/UIEffect/Scripts/UIDissolve.cs @@ -50,6 +50,9 @@ public class UIDissolve : UIEffectBase [Header("Effect Player")] [SerializeField] EffectPlayer m_Player; + [HideInInspector] + [SerializeField] bool m_ReverseAnimation = false; + #pragma warning disable 0414 [Obsolete][HideInInspector] [SerializeField][Range(0.1f, 10)] float m_Duration = 1; @@ -367,7 +370,20 @@ public void Stop() protected override void OnEnable() { base.OnEnable(); - _player.OnEnable(f => effectFactor = f); + if (m_ReverseAnimation) + { + _player.OnEnable((f) => + { + effectFactor = 1f - f; + }); + } + else + { + _player.OnEnable((f) => + { + effectFactor = f; + }); + } } protected override void OnDisable()