public void DespawnAll() { if (spawned) { spawned = false; foreach (GameObject g in activeGuards) { alarmGuardPool.DevolveInstance(g); } activeGuards.Clear(); } }
void Update() { seconds += Time.deltaTime; if (seconds >= time) { //Debug.Log("devolvido"); pooling.DevolveInstance(gameObject); seconds = 0; } }
void Update() { seconds += Time.deltaTime; if (seconds >= time) { UnityEngine.Rigidbody rb = GetComponent <Rigidbody>(); rb.velocity = Vector3.zero; rb.angularVelocity = Vector3.zero; pooler.DevolveInstance(gameObject); seconds = 0; } }