mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2025-12-15 12:29:49 +07:00
update controllers to late update
This commit is contained in:
@@ -349,6 +349,9 @@ namespace FTRuntime {
|
||||
|
||||
void Awake() {
|
||||
_clip = GetComponent<SwfClip>();
|
||||
}
|
||||
|
||||
void Start() {
|
||||
if ( autoPlay && Application.isPlaying ) {
|
||||
Play(false);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user