public static void AttackWithKnife() { GameObject knife = GameObject.Find("Knife(Clone)"); Animator knifeAnimator = knife.GetComponent <Animator>(); knifeAnimator.SetTrigger("Attack"); SpaceshipPlayer player = GameObject.Find("Audio Source").GetComponent <SpaceshipPlayer>(); player.KnifeAttack(); }
public static void UpdateScoreDisplayAndHitPoints() { // Update the displayed score. GameManager.instance.scoreText.text = GameManager.instance.score.ToString("D8"); // Show remaining player hit points under score. SpaceshipPlayer playerShip = GameObject.FindObjectOfType <SpaceshipPlayer>(); if (playerShip != null) { GameManager.instance.scoreText.text += "\n"; for (int i = 0; i < playerShip.hitPoints; i++) { GameManager.instance.scoreText.text += "<color=red>♥</color>"; } } }
void Start() { spaceshipPlayer = audioSource.GetComponent <SpaceshipPlayer>(); }
void Start() { audioPlayer = GetComponentInChildren <SpaceshipPlayer>(); }
void Start() { audioPlayer = GetComponentInChildren <SpaceshipPlayer>(); speed = NORMAL_SPEED; }