first commit

This commit is contained in:
2026-05-25 20:45:05 +03:00
commit bd55a73956
59 changed files with 8597 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
using UnityEngine;
public class Collectible : MonoBehaviour
{
[SerializeField] private int scoreValue = 1;
[SerializeField] private bool destroyOnPickup = true;
private void OnTriggerEnter(Collider other)
{
if (!other.CompareTag("Player"))
{
return;
}
UIManager uiManager = FindObjectOfType<UIManager>();
if (uiManager != null)
{
uiManager.AddScore(scoreValue);
}
Debug.Log($"Collected {name} for {scoreValue} point(s).");
if (destroyOnPickup)
{
Destroy(gameObject);
}
else
{
gameObject.SetActive(false);
}
}
}