25 lines
526 B
C#
25 lines
526 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class TimeBonus : MonoBehaviour, IInteractable
|
|
{
|
|
[SerializeField]
|
|
private int _timeBonus;
|
|
[SerializeField]
|
|
private bool _selfDestroy = true;
|
|
|
|
private vTimerCounter _timerCounter;
|
|
|
|
private void Awake()
|
|
{
|
|
_timerCounter = FindObjectOfType<vTimerCounter>();
|
|
}
|
|
|
|
public void Interact()
|
|
{
|
|
_timerCounter.AddTime(_timeBonus);
|
|
if (_selfDestroy)
|
|
Destroy(gameObject);
|
|
}
|
|
} |