[unity] Code and method signature cleanup (made ApplyAnimation and AfterAnimationApplied public virtual).

This commit is contained in:
Harald Csaszar 2023-11-24 19:32:11 +01:00
parent ba54db2751
commit f029c1d4fd
3 changed files with 17 additions and 11 deletions

View File

@ -232,10 +232,8 @@ namespace Spine.Unity {
return;
UpdateAnimationStatus(deltaTime);
if (updateMode == UpdateMode.OnlyAnimationStatus) {
state.ApplyEventTimelinesOnly(skeleton, issueEvents: false);
if (updateMode == UpdateMode.OnlyAnimationStatus)
return;
}
ApplyAnimation();
}
@ -243,9 +241,14 @@ namespace Spine.Unity {
deltaTime *= timeScale;
state.Update(deltaTime);
skeleton.Update(deltaTime);
if (updateMode == UpdateMode.OnlyAnimationStatus) {
state.ApplyEventTimelinesOnly(skeleton, issueEvents: false);
return;
}
}
protected void ApplyAnimation () {
public virtual void ApplyAnimation () {
if (_BeforeApply != null)
_BeforeApply(this);

View File

@ -353,10 +353,8 @@ namespace Spine.Unity {
return;
UpdateAnimationStatus(deltaTime);
if (updateMode == UpdateMode.OnlyAnimationStatus) {
state.ApplyEventTimelinesOnly(skeleton, issueEvents: false);
if (updateMode == UpdateMode.OnlyAnimationStatus)
return;
}
ApplyAnimation();
}
@ -382,9 +380,14 @@ namespace Spine.Unity {
deltaTime *= timeScale;
state.Update(deltaTime);
skeleton.Update(deltaTime);
if (updateMode == UpdateMode.OnlyAnimationStatus) {
state.ApplyEventTimelinesOnly(skeleton, issueEvents: false);
return;
}
}
protected void ApplyAnimation () {
public virtual void ApplyAnimation () {
if (BeforeApply != null)
BeforeApply(this);
@ -396,7 +399,7 @@ namespace Spine.Unity {
AfterAnimationApplied();
}
public void AfterAnimationApplied () {
public virtual void AfterAnimationApplied () {
if (UpdateLocal != null)
UpdateLocal(this);

View File

@ -127,7 +127,7 @@ namespace Spine.Unity {
ApplyAnimation();
}
protected void ApplyAnimation () {
public virtual void ApplyAnimation () {
if (_BeforeApply != null)
_BeforeApply(this);
@ -152,7 +152,7 @@ namespace Spine.Unity {
AfterAnimationApplied();
}
public void AfterAnimationApplied () {
public virtual void AfterAnimationApplied () {
if (_UpdateLocal != null)
_UpdateLocal(this);