|
@@ -27,10 +27,16 @@
|
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
* THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*****************************************************************************/
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
+#if UNITY_2019_3_OR_NEWER
|
|
|
|
+#define CONFIGURABLE_ENTER_PLAY_MODE
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System;
|
|
using System;
|
|
|
|
|
|
|
|
+
|
|
namespace Spine.Unity.AttachmentTools {
|
|
namespace Spine.Unity.AttachmentTools {
|
|
|
|
|
|
public static class AtlasUtilities {
|
|
public static class AtlasUtilities {
|
|
@@ -41,6 +47,14 @@ namespace Spine.Unity.AttachmentTools {
|
|
|
|
|
|
const int NonrenderingRegion = -1;
|
|
const int NonrenderingRegion = -1;
|
|
|
|
|
|
|
|
+ #if CONFIGURABLE_ENTER_PLAY_MODE
|
|
|
|
+ [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
|
|
|
+ static void Init () {
|
|
|
|
+ // handle disabled domain reload
|
|
|
|
+ AtlasUtilities.ClearCache();
|
|
|
|
+ }
|
|
|
|
+ #endif
|
|
|
|
+
|
|
public static AtlasRegion ToAtlasRegion (this Texture2D t, Material materialPropertySource, float scale = DefaultScale) {
|
|
public static AtlasRegion ToAtlasRegion (this Texture2D t, Material materialPropertySource, float scale = DefaultScale) {
|
|
return t.ToAtlasRegion(materialPropertySource.shader, scale, materialPropertySource);
|
|
return t.ToAtlasRegion(materialPropertySource.shader, scale, materialPropertySource);
|
|
}
|
|
}
|