public void Despawn() { while (spawnedList.Count > 0) { GameObjectContainer toDespawn = spawnedList[0]; spawnedList.RemoveAt(0); GameObjUtil.Destroy(toDespawn.gameObject); } }
public virtual void despawnAll() { foreach (string s in spawned.Keys) { if (spawned[s] != null) { GameObjUtil.Destroy(spawned[s]); } } spawned.Clear(); count = 0; }
// Update is called once per frame void FixedUpdate() { if (collisionState.colliderStatus[starPickup]) { Collider2D[] collArr = collisionState.collidingMembers[starPickup]; foreach (Collider2D coll in collArr) { GameObjUtil.Destroy(coll.gameObject); currentCollected++; } } }
public void Despawn(string name) { for (int i = 0; i < spawnedList.Count; i++) { GameObjectContainer goc = spawnedList[i]; if (string.Compare(goc.name, name) == 0) { spawnedList.RemoveAt(i); GameObjUtil.Destroy(goc.gameObject); i--; } } }
public virtual bool despawn(string objstr) { Debug.Log(objstr); if (spawned.ContainsKey(objstr)) { if (spawned[objstr] != null) { GameObjUtil.Destroy(spawned[objstr]); } spawned.Remove(objstr); count--; return(true); } return(false); }
public void Despawn(GameObject go) { int removeIndex = -1; for (int i = 0; i < spawnedList.Count; i++) { GameObjectContainer goc = spawnedList[i]; if (go == goc.gameObject) { removeIndex = i; } } if (removeIndex >= 0) { GameObjectContainer toRemove = spawnedList[removeIndex]; spawnedList.RemoveAt(removeIndex); GameObjUtil.Destroy(toRemove.gameObject); } }