initial commit

This commit is contained in:
2026-05-29 18:30:19 +03:00
commit feebd5afa5
1068 changed files with 222390 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DebrisPiece : MonoBehaviour
{
private Rigidbody _rb;
private void Awake()
{
_rb = GetComponent<Rigidbody>();
if (_rb == null)
_rb = gameObject.AddComponent<Rigidbody>();
}
public void Launch(Vector3 explosionPos, float force, Material material)
{
if (material != null)
{
MeshRenderer mr = GetComponent<MeshRenderer>();
if (mr != null) mr.sharedMaterial = material;
}
_rb.AddExplosionForce(force, explosionPos, 20f, 3f, ForceMode.Impulse);
_rb.AddTorque(Random.insideUnitSphere * force * 0.8f, ForceMode.Impulse);
Destroy(gameObject, Random.Range(3f, 7f));
}
}