using System.Collections; using System.Collections.Generic; using UnityEngine; public class TimeBonus : MonoBehaviour, ICollectable { [SerializeField] private int _timeBonus; private vTimerCounter _timerCounter; private void Awake() { _timerCounter = FindObjectOfType(); } public void Collect() { _timerCounter.AddTime(_timeBonus); Destroy(gameObject); } }