/// <summary> /// Create a pool to hold a set of spawned objects /// </summary> /// <param name="poolName"></param> /// <param name="obj"></param> /// <returns></returns> public static SpawnerPool Create(string poolName, GameObject obj) { SpawnerPool pool = new SpawnerPool(poolName, obj); SpawnPoolDict.Add(poolName, pool); return(pool); }
void Spawn() { _count--; GameObject obj = SpawnerPool.Spawn(_strPrefabName, transform.position, transform.rotation); Enemy etmp = obj.GetComponent <Enemy>(); if (etmp != null) { etmp.Init(); NextPlayMove(etmp); } //int ix = GetArrRandom(m_arrRatio); //obj.transform.DOMove(_arrTargetPos[ix].position, _DefaultSpeed).SetEase(Ease.Linear); //~~~~~~~~~~ monster info 의 speed 로 변경 필요. }
void ShowPools() { for (int i = 0; i < poolsProperty.arraySize; i++) { currentPool = poolManager.pools[i]; // currentPoolProperty = poolsProperty.GetArrayElementAtIndex(i); if (currentPool.prefab.prefab == null) { DeleteFromArray(poolsProperty, i); break; } GUIStyle style = new GUIStyle("foldout"); style.fontStyle = FontStyle.Bold; if (DeleteFoldOut(poolsProperty, i, currentPool.Name.ToGUIContent(), style)) { break; } } }
public void Kill() { kill_init(); SpawnerPool.Destroy(this.gameObject); }
void Awake() { // Set the global variable _instance = this; }