This repository has been archived on 2026-04-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ludumdare41/Assets/Scripts/Blocks/BlockBush.cs
T

22 lines
473 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BlockBush : MonoBehaviour {
GameObject burnt;
void Awake() {
burnt = transform.GetChild (0).gameObject;
}
void OnTriggerEnter2D(Collider2D collider) {
//TODO: use durability class?
FireDamager fire = collider.gameObject.GetComponent<FireDamager> ();
if (fire != null) {
burnt.SetActive (true);
transform.DetachChildren ();
Destroy (gameObject);
}
}
}