Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (HP.CharHP <= 0)
        {
            if (!bIsMonsterDie)
            {
                HPbar.SetActive(false);
                bIsMonsterDie = true;

                BossAnim.SetTrigger(DieTrigger);
                BossMonsterState = (int)MonsterState.Die;

                BeeInit.StopInstantiate();
                MessageDispatcher.SendMessage(this, "ScorePlus", 2, 0);


                if (MyGameMng != null)
                {
                    MyGameMng.EndStage();
                }

                Die();
            }
            return;
        }


        if (coll.Length == 0)
        {
            Idle();
        }
        else
        {
            SetMonsterState();

            switch (BossMonsterState)
            {
            case (int)MonsterState.Idle:
                Idle();
                break;

            case (int)MonsterState.Chase:
                Move(CalDis(coll));
                break;

            case (int)MonsterState.Attack:
                Attack();
                break;

            case (int)MonsterState.Die:
                Debug.Log("Die");
                return;
            }
        }
    }
Ejemplo n.º 2
0
    public override void Die()
    {
        BossColider.SetActive(false);
        MonsterHPBar.SetActive(false);

        if (BossTimeOut == false)
        {
            MessageDispatcher.SendMessage(this, "ScorePlus", 1, 0);

            if (MyGameMng != null)
            {
                MyGameMng.StopTimeCoroutine();
                MyGameMng.EndStage();
            }
        }

        SpawnedBees = 0;
        BeeInit.StopInstantiate();

        MessageDispatcher.SendMessage(this, "SetAllColiEnable", 0, 0);
        Destroy(this.gameObject, 4.0f);
    }
Ejemplo n.º 3
0
    // Update is called once per frame
    void Update()
    {
        if (HP.CharHP <= 0)
        {
            if (!bIsMonsterDie)
            {
                Nav.velocity  = Vector3.zero;
                Nav.isStopped = true;

                bIsMonsterDie = true;

                BossAnim.SetTrigger(DieTrigger);
                BossMonsterState = (int)MonsterState.Die;

                if (MyGameMng != null)
                {
                    MyGameMng.EndStage();
                }


                Die();
            }
            return;
        }


        if (!isCollision)
        {
            Nav.velocity = Vector3.zero;
            Idle();
        }
        else
        {
            SetMonsterState();

            switch (BossMonsterState)
            {
            case (int)MonsterState.Idle:
                Nav.velocity  = Vector3.zero;
                Nav.isStopped = true;
                Idle();
                break;

            case (int)MonsterState.Chase:
                Nav.isStopped = false;

                Move(PlayerOBJ);
                break;

            case (int)MonsterState.Attack:
                Nav.velocity  = Vector3.zero;
                Nav.isStopped = true;
                Attack();
                break;

            case (int)MonsterState.Die:

                Debug.Log("Die");
                return;
            }
        }
    }