コード例 #1
0
 void Update()
 {
     if (!audioSource.isPlaying)
     {
         poolItem.ReturnToPool();
     }
 }
コード例 #2
0
 public void Explode(GameObject instigator, bool SpawnFX = true)
 {
     if (SpawnFX && DestroyFXPrefab != null)
     {
         var explosion = PoolManager.Instance.GetInstance(DestroyFXPrefab);
         explosion.transform.position = transform.position;
         explosion.transform.rotation = transform.rotation;
     }
     GameManager.Instance.OnDestructibleExplode(this, instigator);
     if (poolItem != null)
     {
         poolItem.ReturnToPool();
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #3
0
 void Destroy() => poolItem.ReturnToPool();