Smoothed out a few things
This commit is contained in:
@@ -21,15 +21,14 @@ public class Player : MonoBehaviour {
|
||||
public GameObject icePelletPrefab;
|
||||
public GameObject windPelletPrefab;
|
||||
|
||||
AudioSource aSource;
|
||||
public AudioClip fireClip, iceClip, windClip, switchClip;
|
||||
|
||||
AudioSource aSource;
|
||||
public AudioClip fireClip, iceClip, windClip, switchClip;
|
||||
|
||||
void Awake() {
|
||||
animator = GetComponent<Animator> ();
|
||||
rigidBody = GetComponent<Rigidbody2D> ();
|
||||
witchAnimateScript = GetComponent<witchAnimate> ();
|
||||
aSource = GetComponent<AudioSource>();
|
||||
aSource = GetComponent<AudioSource>();
|
||||
speed = 0.79f;
|
||||
}
|
||||
|
||||
@@ -55,7 +54,7 @@ public class Player : MonoBehaviour {
|
||||
lastDirection = rigidBody.velocity;
|
||||
}
|
||||
|
||||
if (Input.GetButtonDown("Switch")) aSource.PlayOneShot(switchClip);
|
||||
if (Input.GetButtonDown("Switch")) aSource.PlayOneShot(switchClip);
|
||||
}
|
||||
|
||||
void Move() {
|
||||
@@ -72,16 +71,16 @@ public class Player : MonoBehaviour {
|
||||
|
||||
switch (witchAnimateScript.el) {
|
||||
case witchAnimate.Element.fire:
|
||||
aSource.PlayOneShot(fireClip);
|
||||
aSource.PlayOneShot(fireClip);
|
||||
pellet = Instantiate (firePelletPrefab);
|
||||
break;
|
||||
case witchAnimate.Element.ice:
|
||||
aSource.PlayOneShot(iceClip);
|
||||
pellet = Instantiate (icePelletPrefab);
|
||||
aSource.PlayOneShot(iceClip);
|
||||
pellet = Instantiate (icePelletPrefab);
|
||||
break;
|
||||
case witchAnimate.Element.wind:
|
||||
aSource.PlayOneShot(windClip);
|
||||
pellet = Instantiate (windPelletPrefab);
|
||||
aSource.PlayOneShot(windClip);
|
||||
pellet = Instantiate (windPelletPrefab);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user