diff --git a/Assets/FlashTools/Scripts/FTRuntime/SwfClipController.cs b/Assets/FlashTools/Scripts/FTRuntime/SwfClipController.cs index 28b52e2..c779015 100644 --- a/Assets/FlashTools/Scripts/FTRuntime/SwfClipController.cs +++ b/Assets/FlashTools/Scripts/FTRuntime/SwfClipController.cs @@ -349,6 +349,9 @@ namespace FTRuntime { void Awake() { _clip = GetComponent(); + } + + void Start() { if ( autoPlay && Application.isPlaying ) { Play(false); } diff --git a/Assets/FlashTools/Scripts/FTRuntime/SwfManager.cs b/Assets/FlashTools/Scripts/FTRuntime/SwfManager.cs index 841d537..63a635f 100644 --- a/Assets/FlashTools/Scripts/FTRuntime/SwfManager.cs +++ b/Assets/FlashTools/Scripts/FTRuntime/SwfManager.cs @@ -223,7 +223,16 @@ namespace FTRuntime { _controllers.Clear(); } - void UpdateControllers(float dt) { + void LateUpdateClips() { + for ( int i = 0, e = _clips.Count; i < e; ++i ) { + var clip = _clips[i]; + if ( clip ) { + clip.Internal_LateUpdate(); + } + } + } + + void LateUpdateControllers(float dt) { _controllers.AssignTo(_safeUpdates); for ( int i = 0, e = _safeUpdates.Count; i < e; ++i ) { var ctrl = _safeUpdates[i]; @@ -240,15 +249,6 @@ namespace FTRuntime { _safeUpdates.Clear(); } - void LateUpdateClips() { - for ( int i = 0, e = _clips.Count; i < e; ++i ) { - var clip = _clips[i]; - if ( clip ) { - clip.Internal_LateUpdate(); - } - } - } - // --------------------------------------------------------------------- // // Messages @@ -265,14 +265,11 @@ namespace FTRuntime { DropControllers(); } - void Update() { + void LateUpdate() { if ( isPlaying ) { var dt = Time.deltaTime; - UpdateControllers(rateScale * dt); + LateUpdateControllers(rateScale * dt); } - } - - void LateUpdate() { LateUpdateClips(); } }