mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-16 14:11:19 +07:00
fix life after death and little view stuff
This commit is contained in:
@@ -26,9 +26,9 @@ namespace FTEditor.Editors {
|
|||||||
: 0;
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
string GetClipsFrameCountStr() {
|
string GetClipsFrameCountForView() {
|
||||||
return _clips.Aggregate(string.Empty, (acc, clip) => {
|
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();
|
var frame_count_str = frame_count.ToString();
|
||||||
return string.IsNullOrEmpty(acc)
|
return string.IsNullOrEmpty(acc)
|
||||||
? frame_count_str
|
? frame_count_str
|
||||||
@@ -36,9 +36,9 @@ namespace FTEditor.Editors {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
string GetClipsCurrentFrameStr() {
|
string GetClipsCurrentFrameForView() {
|
||||||
return _clips.Aggregate(string.Empty, (acc, clip) => {
|
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();
|
var current_frame_str = current_frame.ToString();
|
||||||
return string.IsNullOrEmpty(acc)
|
return string.IsNullOrEmpty(acc)
|
||||||
? current_frame_str
|
? current_frame_str
|
||||||
@@ -120,7 +120,7 @@ namespace FTEditor.Editors {
|
|||||||
}
|
}
|
||||||
GUILayout.Label(string.Format(
|
GUILayout.Label(string.Format(
|
||||||
"{0}/{1}",
|
"{0}/{1}",
|
||||||
GetClipsCurrentFrameStr(), GetClipsFrameCountStr()));
|
GetClipsCurrentFrameForView(), GetClipsFrameCountForView()));
|
||||||
if ( GUILayout.Button(new GUIContent(">", "to next frame")) ) {
|
if ( GUILayout.Button(new GUIContent(">", "to next frame")) ) {
|
||||||
AllClipsForeachWithUndo(p => p.ToNextFrame());
|
AllClipsForeachWithUndo(p => p.ToNextFrame());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -352,20 +352,18 @@ namespace FTRuntime {
|
|||||||
_clip = GetComponent<SwfClip>();
|
_clip = GetComponent<SwfClip>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Start() {
|
|
||||||
if ( autoPlay && Application.isPlaying ) {
|
|
||||||
Play(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnEnable() {
|
void OnEnable() {
|
||||||
var swf_manager = SwfManager.GetInstance(true);
|
var swf_manager = SwfManager.GetInstance(true);
|
||||||
if ( swf_manager ) {
|
if ( swf_manager ) {
|
||||||
swf_manager.AddController(this);
|
swf_manager.AddController(this);
|
||||||
}
|
}
|
||||||
|
if ( autoPlay && Application.isPlaying ) {
|
||||||
|
Play(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnDisable() {
|
void OnDisable() {
|
||||||
|
Stop(false);
|
||||||
var swf_manager = SwfManager.GetInstance(false);
|
var swf_manager = SwfManager.GetInstance(false);
|
||||||
if ( swf_manager ) {
|
if ( swf_manager ) {
|
||||||
swf_manager.RemoveController(this);
|
swf_manager.RemoveController(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user