initial commit

This commit is contained in:
2026-06-04 00:55:54 +03:00
commit 89979b009f
1632 changed files with 880133 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
using UnityEngine;
using TMPro;
public class WaterLevelController : MonoBehaviour
{
public TextMeshPro waterLevelText;
public TextMeshPro cubeMassText;
private float waterLevel = 100f;
public float currentCubeVolume = 0f;
public float currentCubeMass = 0f;
void Update()
{
waterLevelText.text = "WATER VOLUME " + (waterLevel + currentCubeVolume).ToString().Replace(",", ".") + "L";
cubeMassText.text = "OBJECT MASS " + currentCubeMass.ToString().Replace(",", ".") + "KG";
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag != "DensityCube") return;
DensityCube dc = other.GetComponent<DensityCube>();
currentCubeVolume = dc.cubeVolume;
currentCubeMass = dc.mass;
}
}