コード例 #1
0
    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();
    }
コード例 #2
0
    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>";
            }
        }
    }
コード例 #3
0
ファイル: SpacePlot.cs プロジェクト: OatmealLick/star-voice
 void Start()
 {
     spaceshipPlayer = audioSource.GetComponent <SpaceshipPlayer>();
 }
コード例 #4
0
ファイル: BlasterGun.cs プロジェクト: epord/GMTK_GameJam_2020
 void Start()
 {
     audioPlayer = GetComponentInChildren <SpaceshipPlayer>();
 }
コード例 #5
0
 void Start()
 {
     audioPlayer = GetComponentInChildren <SpaceshipPlayer>();
     speed       = NORMAL_SPEED;
 }