Exemplo n.º 1
0
    IEnumerator Action()
    {
        while (m_bLive)
        {
            if (m_bAppear == false)
            {
                yield return(null);
            }
            //yield return null;
            yield return(m_secondsDelay);

            if (m_monsterPosition == Monster_Position.Monster_Position_Ground)
            {
                switch (m_eState)
                {
                case MONSTER_STATE.ATTACK:
                    m_monsterMove.isMove = false;
                    if (m_animFunction.GetCurrntAnimClipName() == "idle")
                    {
                        m_monsterMove.MoveDir();
                    }
                    m_monsterAttack.m_bAttack = true;
                    m_animator.SetFloat(m_hashFSpeed, 0);
                    m_monsterMove.GetMoveParent().MoveStop();
                    //m_monsterMove.SetSpeed(0.0f);
                    break;

                case MONSTER_STATE.HIT:
                    m_monsterAttack.m_bAttack = false;
                    m_animator.SetTrigger(m_hashTHit);
                    break;

                case MONSTER_STATE.DIE:
                    m_monsterAttack.m_bAttack = false;
                    m_monsterMove.isMove      = false;

                    m_animator.SetBool(m_hashBLive, false);

                    StageManager.Inst.SetMonsterCount(m_monsterInfo.bOverKill);
                    m_bLive = false;
                    //m_animator.SetTrigger("tDie");
                    //if (m_animFunction.IsTag("knockdown"))
                    //{
                    //    StageManager.Inst.SetMonsterCount(m_monsterInfo.bOverKill);
                    //    m_bLive = false;
                    //}
                    break;

                case MONSTER_STATE.APPEAR:
                    m_monsterAttack.m_bAttack = false;

                    //m_animator.SetBool(m_hashBAppear, true);
                    break;

                case MONSTER_STATE.MOVE:
                    m_monsterAttack.m_bAttack = false;
                    if (m_animFunction.GetCurrntAnimClipName() == "idle")
                    {
                        m_animator.SetFloat(m_hashFSpeed, m_monsterInfo.speed);
                        m_monsterMove.isMove = true;
                    }
                    break;

                case MONSTER_STATE.STUN:
                    break;

                default:
                    break;
                }
            }
        }
    }