feat: initial commit
This commit is contained in:
25
Assets/Common/Timer/Runtime/ScriptableObjects/TimerSO.cs
Normal file
25
Assets/Common/Timer/Runtime/ScriptableObjects/TimerSO.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using TriInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Common.Timer.Runtime.ScriptableObjects
|
||||
{
|
||||
[CreateAssetMenu(fileName = "Timer", menuName = "JoeSiu/Common/Timer")]
|
||||
public class TimerSO : TimerBaseSO
|
||||
{
|
||||
protected override ITimer Timer => _timer;
|
||||
|
||||
[SerializeField, InlineProperty, HideLabel]
|
||||
[InfoBox("The timer in ScriptableObject will be deactivated by default")]
|
||||
private Timer _timer = new(false);
|
||||
|
||||
protected override void Activate_Internal(bool resetTime = false)
|
||||
{
|
||||
_timer.Activate(resetTime);
|
||||
}
|
||||
|
||||
public override void Reinitialize()
|
||||
{
|
||||
_timer = new(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user