15 lines
381 B
C#
Raw Normal View History

2025-07-11 15:42:48 +05:00
using UnityEngine;
public class Collectible : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
CollectBerryGameManager.Instance.IncreaseScore();
Vector3 newPosition = CollectBerryGameManager.Instance.GetRandomPosition();
transform.position = newPosition;
}
}
}