Пример #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Wall")
        {
            flip();
        }
        if (collision.tag == "Enemy")
        {
            flip();
        }
        if (collision.tag == "Player")
        {
            print("I can see the player");
            FindObjectOfType <PlayerStats>().takeDamage(damage);

            AniController.SetTrigger("Hit");
            flip();
        }
    }