예제 #1
0
 public void Push(IPoolElement obj)
 {
     if (obj is T t)
     {
         Push(t);
     }
     else
     {
         throw new InvalidCastException("Can not push object from type: " + obj.GetType());
     }
 }
예제 #2
0
파일: Pool.cs 프로젝트: error911/GGTeam
        public IPoolElement[] GetElements(int count, Transform newParent = null)
        {
            var result = new IPoolElement[count];

            for (int i = 0; i < result.Length; i++)
            {
                result[i] = GetElement(newParent);
            }

            return(result);
        }