// Use this for initialization void Start() { if (InitData != null) { for (int cnt = 0; cnt < InitData.Count; cnt++) { RFObjectPoolInitData opid = InitData[cnt]; // Only allow "properly" filled out objects to be spawned if (opid != null && opid.SourcePrefab != null) { RFObjectPool.Preload(opid.SourcePrefab, opid.ObjectPoolID, opid.StartCount, opid.TargetSpawnParent); } } } isReady = true; }
void OnDestroy() { RFObjectPool.ClearAll(); }