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,43 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ScaleZone : MonoBehaviour
{
private List<Rigidbody> _objects = new List<Rigidbody>();
private void OnTriggerEnter(Collider other)
{
Rigidbody rb = other.GetComponentInParent<Rigidbody>();
if (rb == null) return;
if (!rb.CompareTag("Target")) return;
if (!_objects.Contains(rb))
_objects.Add(rb);
}
private void OnTriggerExit(Collider other)
{
Rigidbody rb = other.GetComponentInParent<Rigidbody>();
if (rb == null) return;
_objects.Remove(rb);
}
public float TotalWeight
{
get
{
float total = 0f;
foreach (var rb in _objects)
{
if (rb != null)
total += rb.mass;
}
return total;
}
}
}