private void OnTriggerEnter(Collider other) { if (other.CompareTag("Wall")) { poolManager.Add("bullet", gameObject); } }
//initialize this pool void Awake() { //add this pool to the PoolManager dictionary PoolManager.Add(this); //set container object to this transform container = transform; //load specified amount of objects before playtime PreLoad(); }
/// <summary> /// Initialization called by PoolManager on runtime created pools. /// </summary> public void Awake() { //can't initialize without prefab if (prefab == null) { return; } //add this pool to the PoolManager dictionary PoolManager.Add(this); //for networked synced pools: get the network identity, //register with the Unity Networking spawning system PreLoad(); }
private void Start() { // add this pool to the list of pool manager PoolManager.Add(this); objToPool = ProductToPool.gameObject; for (int i = 0; i < amountTopool; i++) { GameObject poolObj = Instantiate(objToPool, transform); poolObj.SetActive(false); poolObj.GetComponent <DisableObjectAfterTime>().pool = this; pool.Add(poolObj); } }
protected void Awake() { members = new List <T>(); foreach (Transform child in transform) { T item = child.GetComponent <T>(); if (item != null) { Add(item); } } if (copyOnStart > 0) { copiesPending = copyOnStart; AddClones(copyRate); } PoolManager.Add(this); OnAwake(); }
private void Awake() { ThisGameObjectPosition = transform; PreLoadGameObject(); PoolManager.Add(this); }
public void AddToPool(GameObject obj) { poolManager.Add("bullet", obj); }
// Use this for initialization void Start() { timer = deltaTime; PoolManager.Add(decalName, Mathf.CeilToInt((float)1 / deltaTime) + 1); Debug.Log("z"); }