mirror of
https://github.com/ConjureETS/Bomberman.git
synced 2026-03-24 18:30:58 +00:00
20 lines
346 B
C#
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);
|
|
}
|
|
} |