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); } }
public void SwitchTurn() { DamageOverTurn.DealPoisonDamageToAllPoisoned(); string looserTag; if (CheckIfGameEnded(out looserTag)) { EndGame(looserTag); return; } TreasureBoxSpawner.SpawnTreasureBox(); GiveTurnAndShowText(); }