コード例 #1
0
        private void OnTriggerExit(Collider other)
        {
            --count;
            if (count > 0)
            {
                return;
            }

            PoolManagerScript.Despawn(spawnedLevel);
        }
コード例 #2
0
 /// <summary>
 /// Called by the spawned object to destroy itself on this managing component.
 /// For example when it has been collected by players.
 /// </summary>
 public void Destroy()
 {
     //despawn object and clear references
     PoolManagerScript.Despawn(obj);
     obj = null;
 }