[unity] Fixed animation not playing first time entering play mode after compilation. Related to disabled Domain/Scene reload. See #1621.

This commit is contained in:
Harald Csaszar 2020-10-19 18:46:07 +02:00
parent 17e8373e47
commit d4654588fb

View File

@ -39,6 +39,10 @@
#define BUILT_IN_SPRITE_MASK_COMPONENT
#endif
#if UNITY_2019_3_OR_NEWER
#define CONFIGURABLE_ENTER_PLAY_MODE
#endif
#define SPINE_OPTIONAL_RENDEROVERRIDE
#define SPINE_OPTIONAL_MATERIALOVERRIDE
@ -276,6 +280,12 @@ namespace Spine.Unity {
Initialize(false);
}
#if UNITY_EDITOR && CONFIGURABLE_ENTER_PLAY_MODE
public virtual void Start () {
Initialize(false);
}
#endif
void OnDisable () {
if (clearStateOnDisable && valid)
ClearState();