コード例 #1
0
        private void RemoveObject()
        {
            if (this.destroyClip != null)
            {
                AudioPlayer.Play(this.destroyClip);
            }

            PoolManager.Despawn(this.gameObject);
        }
コード例 #2
0
 public void Despawn()
 {
     StopAllCoroutines();
     if (PoolManager.HasPool(this.gameObject))
     {
         PoolManager.Despawn(this.gameObject);
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
コード例 #3
0
        public void Despawn(GameObject spawnedObject)
        {
            if (spawnedObject.activeSelf)
            {
                PoolManager.Despawn(spawnedObject);
            }

            if (this.spawnedObjects.Contains(spawnedObject))
            {
                this.spawnedObjects.Remove(spawnedObject);
            }
        }
コード例 #4
0
        public void DespawnAll()
        {
            for (int i = 0; i < this.spawnedObjects.Count; i++)
            {
                var spawnedObject = this.spawnedObjects[i];
                if (spawnedObject.activeSelf)
                {
                    PoolManager.Despawn(spawnedObject);
                }
            }

            this.spawnedObjects.Clear();
        }