[Unity] Minor update to sample scene scripts.

This commit is contained in:
pharan 2015-12-31 09:45:14 +08:00
parent fb9f53ee23
commit e116c15ffb
3 changed files with 9 additions and 8 deletions

View File

@ -62,6 +62,7 @@ public class BasicPlatformerController : MonoBehaviour {
public AudioSource jumpAudioSource; public AudioSource jumpAudioSource;
public AudioSource hardfallAudioSource; public AudioSource hardfallAudioSource;
public AudioSource footstepAudioSource; public AudioSource footstepAudioSource;
[SpineEvent]
public string footstepEventName = "Footstep"; public string footstepEventName = "Footstep";
CharacterController controller; CharacterController controller;
Vector2 velocity = Vector2.zero; Vector2 velocity = Vector2.zero;

View File

@ -18,11 +18,11 @@ public class RaggedySpineboy : MonoBehaviour {
void AddRigidbody () { void AddRigidbody () {
var rb = gameObject.AddComponent<Rigidbody2D>(); var rb = gameObject.AddComponent<Rigidbody2D>();
#if UNITY_5_1 #if UNITY_5_1 || UNITY_5_2 || UNITY_5_3 || UNITY_5_4 || UNITY_5_5
rb.freezeRotation = true; rb.freezeRotation = true;
#else #else
rb.fixedAngle = true; rb.fixedAngle = true;
#endif #endif
naturalCollider.enabled = true; naturalCollider.enabled = true;
} }

View File

@ -11,11 +11,11 @@ using System.Collections;
public class SpineboyController : MonoBehaviour { public class SpineboyController : MonoBehaviour {
SkeletonAnimation skeletonAnimation; SkeletonAnimation skeletonAnimation;
public string idleAnimation = "idle"; [SpineAnimation] public string idleAnimation = "idle";
public string walkAnimation = "walk"; [SpineAnimation] public string walkAnimation = "walk";
public string runAnimation = "run"; [SpineAnimation] public string runAnimation = "run";
public string hitAnimation = "hit"; [SpineAnimation] public string hitAnimation = "hit";
public string deathAnimation = "death"; [SpineAnimation] public string deathAnimation = "death";
public float walkVelocity = 1; public float walkVelocity = 1;
public float runVelocity = 3; public float runVelocity = 3;
public int hp = 10; public int hp = 10;