Exemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (GameSceneManager.LOGGING)
        {
            Debug.Log("Collided Gameobject name:" + collision.gameObject.name);
        }

        if (collision.gameObject.tag == GameSceneManager.TILE_TAG)
        {
            FloorTile _tile = collision.gameObject.GetComponent <FloorTile>();
            if (_tile.TileTypeGetSet == FloorTile.TileType.Tentative)
            {
                manager.RestartTurn();
            }
        }
        else if (collision.gameObject.tag == GameSceneManager.ENEMY_TAG)
        {
            manager.RestartTurn();
        }
        if (collision.gameObject.tag == GameSceneManager.POWERUPS_TAG)
        {
            manager.ApplySlowSpell();
            collision.gameObject.SetActive(false);
        }
    }