Browse Source

Merge branch '4.0' into 4.1-beta

Harald Csaszar 3 years ago
parent
commit
b9606f0074

+ 1 - 1
spine-unity/Assets/Spine Examples/Getting Started/4 Object Oriented Sample.unity

@@ -193,7 +193,7 @@ TextMesh:
   m_Text: 'Enter <b>PLAY MODE</b> in Unity to see Spineboy animate.
   m_Text: 'Enter <b>PLAY MODE</b> in Unity to see Spineboy animate.
 
 
     Try moving, jumping, aiming and shooting. (WASD+Spacebar+Left&Right Click, or
     Try moving, jumping, aiming and shooting. (WASD+Spacebar+Left&Right Click, or
-    XBOX Controller)'
+    Gamepad)'
   m_OffsetZ: 0
   m_OffsetZ: 0
   m_CharacterSize: 0.12
   m_CharacterSize: 0.12
   m_LineSpacing: 1
   m_LineSpacing: 1

+ 1 - 1
spine-unity/Assets/Spine Examples/Getting Started/5 Basic Platformer.unity

@@ -873,7 +873,7 @@ TextMesh:
   m_GameObject: {fileID: 522034802}
   m_GameObject: {fileID: 522034802}
   m_Text: 'Enter <b>PLAY MODE</b> in Unity to see bearded hero guy animate.
   m_Text: 'Enter <b>PLAY MODE</b> in Unity to see bearded hero guy animate.
 
 
-    Try moving and jumping. (WASD+Spacebar, or XBOX Controller)'
+    Try moving and jumping. (WASD+Spacebar, or Gamepad)'
   m_OffsetZ: 0
   m_OffsetZ: 0
   m_CharacterSize: 0.1
   m_CharacterSize: 0.1
   m_LineSpacing: 1
   m_LineSpacing: 1

+ 1 - 1
spine-unity/Assets/Spine Examples/Other Examples/SkeletonUtility Platformer HingeChain Physics.unity

@@ -1421,7 +1421,7 @@ TextMesh:
 
 
     animated via physics.
     animated via physics.
 
 
-    Try moving and jumping. (WASD+Spacebar, or XBOX Controller)'
+    Try moving and jumping. (WASD+Spacebar, or Gamepad)'
   m_OffsetZ: 0
   m_OffsetZ: 0
   m_CharacterSize: 0.1
   m_CharacterSize: 0.1
   m_LineSpacing: 1
   m_LineSpacing: 1

+ 3 - 6
spine-unity/Assets/Spine Examples/Scripts/Getting Started Scripts/SpineboyBeginnerView.cs

@@ -126,15 +126,13 @@ namespace Spine.Unity.Examples {
 			var shootTrack = skeletonAnimation.AnimationState.SetAnimation(1, shoot, false);
 			var shootTrack = skeletonAnimation.AnimationState.SetAnimation(1, shoot, false);
 			shootTrack.AttachmentThreshold = 1f;
 			shootTrack.AttachmentThreshold = 1f;
 			shootTrack.MixDuration = 0f;
 			shootTrack.MixDuration = 0f;
-			var empty1 = skeletonAnimation.state.AddEmptyAnimation(1, 0.5f, 0.1f);
-			empty1.AttachmentThreshold = 1f;
+			skeletonAnimation.state.AddEmptyAnimation(1, 0.5f, 0.1f);
 
 
 			// Play the aim animation on track 2 to aim at the mouse target.
 			// Play the aim animation on track 2 to aim at the mouse target.
 			var aimTrack = skeletonAnimation.AnimationState.SetAnimation(2, aim, false);
 			var aimTrack = skeletonAnimation.AnimationState.SetAnimation(2, aim, false);
 			aimTrack.AttachmentThreshold = 1f;
 			aimTrack.AttachmentThreshold = 1f;
 			aimTrack.MixDuration = 0f;
 			aimTrack.MixDuration = 0f;
-			var empty2 = skeletonAnimation.state.AddEmptyAnimation(2, 0.5f, 0.1f);
-			empty2.AttachmentThreshold = 1f;
+			skeletonAnimation.state.AddEmptyAnimation(2, 0.5f, 0.1f);
 
 
 			gunSource.pitch = GetRandomPitch(gunsoundPitchOffset);
 			gunSource.pitch = GetRandomPitch(gunsoundPitchOffset);
 			gunSource.Play();
 			gunSource.Play();
@@ -150,8 +148,7 @@ namespace Spine.Unity.Examples {
 		}
 		}
 
 
 		public void StopPlayingAim () {
 		public void StopPlayingAim () {
-			var empty2 = skeletonAnimation.state.AddEmptyAnimation(2, 0.5f, 0.1f);
-			empty2.AttachmentThreshold = 1f;
+			skeletonAnimation.state.AddEmptyAnimation(2, 0.5f, 0.1f);
 		}
 		}
 
 
 		public void Turn (bool facingLeft) {
 		public void Turn (bool facingLeft) {

+ 4 - 2
spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRendererCustomMaterials/SkeletonRendererCustomMaterials.cs

@@ -90,7 +90,8 @@ namespace Spine.Unity {
 					continue;
 					continue;
 
 
 				Slot slotObject = skeletonRenderer.skeleton.FindSlot(slotMaterialOverride.slotName);
 				Slot slotObject = skeletonRenderer.skeleton.FindSlot(slotMaterialOverride.slotName);
-				skeletonRenderer.CustomSlotMaterials[slotObject] = slotMaterialOverride.material;
+				if (slotObject != null)
+					skeletonRenderer.CustomSlotMaterials[slotObject] = slotMaterialOverride.material;
 			}
 			}
 		}
 		}
 
 
@@ -106,7 +107,8 @@ namespace Spine.Unity {
 					continue;
 					continue;
 
 
 				Slot slotObject = skeletonRenderer.skeleton.FindSlot(slotMaterialOverride.slotName);
 				Slot slotObject = skeletonRenderer.skeleton.FindSlot(slotMaterialOverride.slotName);
-
+				if (slotObject == null)
+					continue;
 				Material currentMaterial;
 				Material currentMaterial;
 				if (!skeletonRenderer.CustomSlotMaterials.TryGetValue(slotObject, out currentMaterial))
 				if (!skeletonRenderer.CustomSlotMaterials.TryGetValue(slotObject, out currentMaterial))
 					continue;
 					continue;