Ejemplo n.º 1
0
    private void OnCollisionEnter2D(Collision2D collision)
    {
        if (falling)
        {
            parachute.gameObject.SetActive(false);
            falling = false;
        }

        TankController controller = collision.gameObject.GetComponent <TankController>();

        if (controller != null)
        {
            controller.currentWeapon.superWeaponType = type;
            if (collision.gameObject.CompareTag("TankPlayer"))
            {
                TurnController.INSTANCE.SuperWeaponButton_SetActive(true);
                TreasureBoxSpawner.PickLeftTreasure();
            }
            else
            {
                TreasureBoxSpawner.PickRightTreasure();
            }

            PoolingSystem.Despawn(gameObject);
        }
    }
Ejemplo n.º 2
0
    public void SwitchTurn()
    {
        DamageOverTurn.DealPoisonDamageToAllPoisoned();

        string looserTag;

        if (CheckIfGameEnded(out looserTag))
        {
            EndGame(looserTag);
            return;
        }

        TreasureBoxSpawner.SpawnTreasureBox();
        GiveTurnAndShowText();
    }