Browse Source

Merge branch '4.1' into 4.2-beta

Harald Csaszar 2 years ago
parent
commit
12076b1f75

+ 8 - 2
spine-unity/Assets/Spine Examples/Scripts/Sample Components/RenderExistingMesh.cs

@@ -101,10 +101,15 @@ namespace Spine.Unity.Examples {
 		}
 
 #if UNITY_EDITOR
+		// handle disabled scene reload
+		private void OnEnable () {
+			if (Application.isPlaying)
+				Awake();
+		}
+
 		private void Update () {
-			if (!Application.isPlaying) {
+			if (!Application.isPlaying)
 				InitializeDict();
-			}
 		}
 #endif
 
@@ -142,6 +147,7 @@ namespace Spine.Unity.Examples {
 		}
 
 		void InitializeDict () {
+			replacementMaterialDict.Clear();
 			for (int i = 0; i < replacementMaterials.Length; ++i) {
 				MaterialReplacement entry = replacementMaterials[i];
 				replacementMaterialDict[entry.originalMaterial] = entry.replacementMaterial;

+ 2 - 2
spine-unity/Assets/Spine Examples/package.json

@@ -2,7 +2,7 @@
   "name": "com.esotericsoftware.spine.spine-unity-examples",
   "displayName": "spine-unity Runtime Examples",
   "description": "This plugin provides example scenes and scripts for the spine-unity runtime.",
-  "version": "4.2.0",
+  "version": "4.2.10",
   "unity": "2018.3",
   "author": {
     "name": "Esoteric Software",
@@ -30,4 +30,4 @@
   },
   "homepage": "https://github.com/EsotericSoftware/spine-runtimes#readme",
   "type": "sample"
-}
+}