예제 #1
0
 public void Release()
 {
     if (pool != null)
     {
         pool.Free(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     life -= Time.deltaTime;
     if (life <= 0)
     {
         if (pool != null)
         {
             pool.Free(gameObject);
         }
         else
         {
             Destroy(this);
         }
     }
 }