Added assets from old repo
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class GenericDestructable : MonoBehaviour
|
||||
{
|
||||
|
||||
// Designed by Jacob Weedman
|
||||
|
||||
public string mode = "DESTROY"; // "DESTROY". "DISABLE"
|
||||
public bool AttackableByPlayer = true;
|
||||
public float Health = 100;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (Health <= 0)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case "DESTROY":
|
||||
Destroy(gameObject);
|
||||
break;
|
||||
case "DISABLE":
|
||||
gameObject.tag = "Destroyed";
|
||||
GetComponent<GenericDestructable>().enabled = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user