2020-06-28 19:12:59 -04:00

20 lines
346 B
C#

using UnityEngine;
public class Bomb : MonoBehaviour {
public float delay = 3f;
int strength;
Arena arena;
public void Init(int strength, Arena arena) {
this.strength = strength;
this.arena = arena;
Invoke(nameof(Explode), delay);
}
void Explode() {
arena.Explode(transform.position, strength);
Destroy(gameObject);
}
}