mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 18:02:38 +08:00
add initial play animation delay option to UIShiny
This commit is contained in:
@@ -19,6 +19,13 @@ namespace Coffee.UIExtensions
|
||||
[Tooltip("Playing.")]
|
||||
public bool play = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the delay before looping.
|
||||
/// </summary>
|
||||
[Tooltip("Initial play delay.")]
|
||||
[Range(0f, 10f)]
|
||||
public float initialPlayDelay = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether can loop.
|
||||
/// </summary>
|
||||
@@ -67,7 +74,14 @@ namespace Coffee.UIExtensions
|
||||
}
|
||||
s_UpdateActions.Add(OnWillRenderCanvases);
|
||||
|
||||
_time = 0;
|
||||
if (play)
|
||||
{
|
||||
_time = -initialPlayDelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
_time = 0;
|
||||
}
|
||||
_callback = callback;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace Coffee.UIExtensions.Editors
|
||||
var player = serializedObject.FindProperty("m_Player");
|
||||
_spPlay = player.FindPropertyRelative("play");
|
||||
_spDuration = player.FindPropertyRelative("duration");
|
||||
_spInitialPlayDelay = player.FindPropertyRelative("initialPlayDelay");
|
||||
_spLoop = player.FindPropertyRelative("loop");
|
||||
_spLoopDelay = player.FindPropertyRelative("loopDelay");
|
||||
_spUpdateMode = player.FindPropertyRelative("updateMode");
|
||||
@@ -75,6 +76,10 @@ namespace Coffee.UIExtensions.Editors
|
||||
GUILayout.Space(10);
|
||||
EditorGUILayout.LabelField("Effect Player", EditorStyles.boldLabel);
|
||||
EditorGUILayout.PropertyField(_spPlay);
|
||||
if (_spPlay.boolValue)
|
||||
{
|
||||
EditorGUILayout.PropertyField(_spInitialPlayDelay);
|
||||
}
|
||||
EditorGUILayout.PropertyField(_spDuration);
|
||||
EditorGUILayout.PropertyField(_spLoop);
|
||||
EditorGUILayout.PropertyField(_spLoopDelay);
|
||||
@@ -115,6 +120,7 @@ namespace Coffee.UIExtensions.Editors
|
||||
SerializedProperty _spLoop;
|
||||
SerializedProperty _spLoopDelay;
|
||||
SerializedProperty _spDuration;
|
||||
SerializedProperty _spInitialPlayDelay;
|
||||
SerializedProperty _spUpdateMode;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user