update controllers to late update

This commit is contained in:
2016-12-05 02:17:27 +07:00
parent 12bd825c40
commit a2ebc12004
2 changed files with 15 additions and 15 deletions

View File

@@ -349,6 +349,9 @@ namespace FTRuntime {
void Awake() { void Awake() {
_clip = GetComponent<SwfClip>(); _clip = GetComponent<SwfClip>();
}
void Start() {
if ( autoPlay && Application.isPlaying ) { if ( autoPlay && Application.isPlaying ) {
Play(false); Play(false);
} }

View File

@@ -223,7 +223,16 @@ namespace FTRuntime {
_controllers.Clear(); _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); _controllers.AssignTo(_safeUpdates);
for ( int i = 0, e = _safeUpdates.Count; i < e; ++i ) { for ( int i = 0, e = _safeUpdates.Count; i < e; ++i ) {
var ctrl = _safeUpdates[i]; var ctrl = _safeUpdates[i];
@@ -240,15 +249,6 @@ namespace FTRuntime {
_safeUpdates.Clear(); _safeUpdates.Clear();
} }
void LateUpdateClips() {
for ( int i = 0, e = _clips.Count; i < e; ++i ) {
var clip = _clips[i];
if ( clip ) {
clip.Internal_LateUpdate();
}
}
}
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
// //
// Messages // Messages
@@ -265,14 +265,11 @@ namespace FTRuntime {
DropControllers(); DropControllers();
} }
void Update() { void LateUpdate() {
if ( isPlaying ) { if ( isPlaying ) {
var dt = Time.deltaTime; var dt = Time.deltaTime;
UpdateControllers(rateScale * dt); LateUpdateControllers(rateScale * dt);
} }
}
void LateUpdate() {
LateUpdateClips(); LateUpdateClips();
} }
} }