This commit is contained in:
2025-09-17 18:56:28 +08:00
commit 54c72710a5
5244 changed files with 5717609 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
using UnityEngine;
namespace DestroyIt
{
/// <summary>
/// This script applies damage to all destructible objects in the scene every time you press the "0" key.
/// This script is for testing purposes.
/// </summary>
[DisallowMultipleComponent]
public class DestructionTest : MonoBehaviour
{
public Destructible objectToDestroy;
public int damagePerPress = 13; // The amount of damage to apply to all destructible objects per keypress.
public void Update()
{
if (Input.GetKeyUp("0"))
{
if (objectToDestroy != null)
objectToDestroy.ApplyDamage(damagePerPress);
else
{
Destructible[] destObjs = FindObjectsOfType<Destructible>();
foreach (Destructible destObj in destObjs)
destObj.ApplyDamage(damagePerPress);
}
}
}
}
}