first commit

This commit is contained in:
2026-04-07 03:14:32 +03:00
commit b3992fec6b
1026 changed files with 366769 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using UnityEngine;
namespace YueDestructibles
{
public class YueDestructiblesRoot : MonoBehaviour
{
private Rigidbody[] debris;
private float dissapearingSpeed = 0f;
private float size = 1f;
public void SetDisappearingTime(float time)
{
dissapearingSpeed = 1 / time;
}
public void SetDebris(Rigidbody[] rb)
{
debris = rb;
}
private void Update()
{
// Update Size until 0, then destroy
size -= Time.deltaTime * dissapearingSpeed;
foreach(Rigidbody r in debris)
{
r.transform.localScale = Vector3.one * size;
}
if(size <= 0.05f)
Destroy(gameObject);
}
}
}