예제 #1
0
    private void OnTriggerStay2D(Collider2D collision)
    {
        if (m_IsPause == true)
        {
            return;
        }

        CharacterHero hero = collision.GetComponent <CharacterHero>();

        if (collision.tag == "Hero")
        {
            if (m_IsAttack == false && m_IsMove == false && m_IsDead == false && m_IsPause == false &&
                hero.IsDead == false)
            {
                StartCoroutine(Attack(hero));
            }
            else if (m_IsAttack == false && m_IsMove == true && m_IsDead == true && m_IsPause == false &&
                     hero.IsDead == false)
            {
                StartMoveMonster();
            }
        }
    }