public static void IntializeDriver() { if (null == driver) { driver = TimerDriver.Initialize(); } }
/// <summary> /// 初始化计时器驱动 /// </summary> /// <returns>驱动的实例</returns> public static TimerDriver Initialize() { if (!Application.isPlaying) { return(null); } if (!hasInit) { hasInit = true; _instance = new GameObject("TimerEntity").AddComponent <TimerDriver>(); //_instance.gameObject.hideFlags = HideFlags.HideAndDontSave; } return(_instance); }
private void Awake() { _instance = this; hasInit = true; }