15 lines
381 B
C#
15 lines
381 B
C#
![]() |
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;
|
||
|
}
|
||
|
}
|
||
|
}
|