Added the Rube Goldberg MAchine

This commit is contained in:
2025-11-25 20:41:14 +01:00
parent 17d48c5812
commit 9aafafece4
22 changed files with 4786 additions and 28 deletions

View File

@@ -2,9 +2,24 @@ using UnityEngine;
public class Destroyer : MonoBehaviour
{
[SerializeField]
private GameObject targetToDestroy;
// Destroy the GameObject this component is attached to
public void DestroySelf()
{
Destroy(gameObject);
}
// Destroy the GameObject assigned in the inspector
public void DestroyTarget()
{
if (targetToDestroy == null)
{
Debug.LogWarning("Destroyer: No target assigned to destroy.", this);
return;
}
Destroy(targetToDestroy);
}
}