diff --git a/Assets/FlashTools/Scripts/Editor/FTEditor/Editors/SwfClipEditor.cs b/Assets/FlashTools/Scripts/Editor/FTEditor/Editors/SwfClipEditor.cs index f96f618..166f691 100644 --- a/Assets/FlashTools/Scripts/Editor/FTEditor/Editors/SwfClipEditor.cs +++ b/Assets/FlashTools/Scripts/Editor/FTEditor/Editors/SwfClipEditor.cs @@ -26,9 +26,9 @@ namespace FTEditor.Editors { : 0; } - string GetClipsFrameCountStr() { + string GetClipsFrameCountForView() { return _clips.Aggregate(string.Empty, (acc, clip) => { - var frame_count = clip.frameCount > 0 ? clip.frameCount - 1 : 0; + var frame_count = clip.frameCount; var frame_count_str = frame_count.ToString(); return string.IsNullOrEmpty(acc) ? frame_count_str @@ -36,9 +36,9 @@ namespace FTEditor.Editors { }); } - string GetClipsCurrentFrameStr() { + string GetClipsCurrentFrameForView() { return _clips.Aggregate(string.Empty, (acc, clip) => { - var current_frame = clip.currentFrame; + var current_frame = clip.currentFrame + 1; var current_frame_str = current_frame.ToString(); return string.IsNullOrEmpty(acc) ? current_frame_str @@ -120,7 +120,7 @@ namespace FTEditor.Editors { } GUILayout.Label(string.Format( "{0}/{1}", - GetClipsCurrentFrameStr(), GetClipsFrameCountStr())); + GetClipsCurrentFrameForView(), GetClipsFrameCountForView())); if ( GUILayout.Button(new GUIContent(">", "to next frame")) ) { AllClipsForeachWithUndo(p => p.ToNextFrame()); } diff --git a/Assets/FlashTools/Scripts/FTRuntime/SwfClipController.cs b/Assets/FlashTools/Scripts/FTRuntime/SwfClipController.cs index b8c47e2..88bec50 100644 --- a/Assets/FlashTools/Scripts/FTRuntime/SwfClipController.cs +++ b/Assets/FlashTools/Scripts/FTRuntime/SwfClipController.cs @@ -352,20 +352,18 @@ namespace FTRuntime { _clip = GetComponent(); } - void Start() { - if ( autoPlay && Application.isPlaying ) { - Play(false); - } - } - void OnEnable() { var swf_manager = SwfManager.GetInstance(true); if ( swf_manager ) { swf_manager.AddController(this); } + if ( autoPlay && Application.isPlaying ) { + Play(false); + } } void OnDisable() { + Stop(false); var swf_manager = SwfManager.GetInstance(false); if ( swf_manager ) { swf_manager.RemoveController(this);