Exemple #1
0
 public static PollingBullet GetObjcet()
 {
     if (Instance.pollingObjectQueue.Count > 0)
     {
         var poolObject = Instance.pollingObjectQueue.Dequeue();
         poolObject.transform.SetParent(null);
         poolObject.gameObject.SetActive(true);
         return(poolObject);
     }
     else
     {
         var newObject = Instance.CreateBulletObject();
         newObject.transform.SetParent(null);
         newObject.gameObject.SetActive(true);
         return(newObject);
     }
 }