Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        if (this.BossLastHP > this.BossHP)
        {
            AudioSource.PlayClipAtPoint(DamageSE, transform.position);
        }

        this.BossLastHP = this.BossHP;

        this.transform.position = new Vector3(0, this.transform.position.y, Player.transform.position.z + 12);
        m_CurrentMove.OnUpdate();

        this.waittime += Time.deltaTime;

        if (this.waittime >= Setting.Cooltime)
        {
            isAttack      = true;
            this.waittime = 0;
        }

        if (isAttack == true)
        {
            Attack();
        }

        if (this.BossHP <= 0)
        {
            //this.gameDirector.GetComponent<GameDirector>().isStageClear = true;
            AudioSource.PlayClipAtPoint(DefeatSE, transform.position);


            if (isDeath == false)
            {
                this.myAnimator.SetTrigger("DeathTrigger");
                this.gameDirector.GetComponent <GameDirector>().isBossDefeat = true;
            }

            Invoke("Defeat", 2.5f);
        }

        if (this.gameDirector.GetComponent <GameDirector>().index == GameDirector.Index.PlayerSelect)
        {
            Destroy(this.gameObject);
        }
    }