Near finish
This commit is contained in:
@@ -5,7 +5,23 @@ using UnityEngine;
|
||||
public class Obstacle : MonoBehaviour
|
||||
{
|
||||
void OnTriggerEnter2D(Collider2D other){
|
||||
|
||||
if(other.tag == "Powerup"){
|
||||
LevelGeneratorV2.instance.DespawnPickup(other.gameObject);
|
||||
PlayerController.instance.ActivatePowerup();
|
||||
return;
|
||||
}
|
||||
Debug.Log(other.name);
|
||||
|
||||
if(other.tag == "asteroid"){
|
||||
if(PlayerController.instance.PowerupActive){
|
||||
PlayerController.instance.SpawnExplosionFX(other.transform.position);
|
||||
LevelGeneratorV2.instance.DespawnAsteroid(other.gameObject);
|
||||
DataManager.AddItem("add_asteroid.php");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
PlayerController.instance.GameOver();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user