/// <summary> /// 初始化对象池, 在取消自动初始化时需要调用该方法进行初始化. /// </summary> public void Init() { if (_pool == null) { _pool = new AutoObjectPool <GameObject>(new GameObjectFactory <T>(source, dontDestroyOnLoad, this.gameObject), maxIdleCount); } }
void Awake() { _pool = new AutoObjectPool <GameObject>(new GameObjectFactory <T>(source, dontDestroyOnLoad, this.gameObject), maxIdleCount); }