Пример #1
0
    private void OnTriggerStay(Collider other)
    {
        if (other.tag == "RunningNPC")
        {
            NonPlayerCharacter nonPlayer = other.gameObject.GetComponent <NonPlayerCharacter>();
            other.gameObject.tag = "EscapeNPC";
            StartCoroutine(nonPlayer.ChangeState());
        }
        if (other.tag == "Enemy")
        {
            EnemyCharacter nonPlayer = other.gameObject.GetComponent <EnemyCharacter>();
            other.gameObject.tag = "AttackEnemy";

            nonPlayer.ChangeState(playHitPoint);
        }
    }