From d4654588fb224fb65f92d3f87fc73594abd02cbb Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 19 Oct 2020 18:46:07 +0200 Subject: [PATCH] [unity] Fixed animation not playing first time entering play mode after compilation. Related to disabled Domain/Scene reload. See #1621. --- .../Runtime/spine-unity/Components/SkeletonRenderer.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs index 77c7433cf..519bf334f 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs @@ -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();