fix:1、添加项目
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
public enum TimerTimeType : int
|
||||
{
|
||||
Null = -1,
|
||||
Time = 0,
|
||||
UnscaledTime = 1,
|
||||
RealtimeSinceStartup = 2,
|
||||
}
|
||||
|
||||
public sealed class TimerIManager : BaseUnityManager<TimerIManager>
|
||||
{
|
||||
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 EasyTimer CreateSimpleTimer(string name, TimerTimeType type)
|
||||
{
|
||||
EasyTimer easyTimer = simpleTimersRoot.AddComponent<EasyTimer>();
|
||||
easyTimer.SetTimer(name, type);
|
||||
return easyTimer;
|
||||
}
|
||||
|
||||
public Timer CreateTimer(string name, TimerTimeType type)
|
||||
{
|
||||
Timer timer = timersRoot.AddComponent<Timer>();
|
||||
timer.SetTimer(name, type);
|
||||
return timer;
|
||||
}
|
||||
|
||||
#region Mgr
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
base.Init();
|
||||
InitTimersRoot();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user