using UnityEngine; namespace BingoBrain.Core { public enum TimerTimeType : int { Null = -1, Time = 0, UnscaledTime = 1, RealtimeSinceStartup = 2, } public sealed class TimerI : BaseUnity { private GameObject simpleTimersRoot; private GameObject timersRoot; private GameObject heavyTimersRoot; private void InitTimersRoot() { simpleTimersRoot = new GameObject("SimpleTimers"); simpleTimersRoot.SetParent(gameObject); timersRoot = new GameObject("Timers"); timersRoot.SetParent(gameObject); heavyTimersRoot = new GameObject("HeavyTimers"); heavyTimersRoot.SetParent(gameObject); } public YFsa CreateSimpleTimer(string name, TimerTimeType type) { YFsa yFsa = simpleTimersRoot.AddComponent(); yFsa.SetTimer(name, type); return yFsa; } public Psvsa CreateTimer(string name, TimerTimeType type) { Psvsa psvsa = timersRoot.AddComponent(); psvsa.SetTimer(name, type); return psvsa; } public UFdsa CreateHeavyTimer(string name, TimerTimeType type) { UFdsa uFdsa = heavyTimersRoot.AddComponent(); uFdsa.SetTimer(name, type); return uFdsa; } #region Mgr public override void Init() { base.Init(); InitTimersRoot(); } protected override void OnDestroy() { base.OnDestroy(); } #endregion } }