예제 #1
0
 /// <summary>
 /// Disable this Object. (해당 Object를 비활성화 시킵니다.)
 /// </summary>
 /// <param name="obj">The object that will be disabled. (비활성화할 Object입니다.)</param>
 /// <param name="delay">Delay before disable. (비활성화 되기 전 딜레이입니다.)</param>
 public void DisableObject(PooledObject obj, float delay)
 {
     pooledObjects_.Find(o => o.Equals(obj)).enabled = false;
 }
예제 #2
0
        public static void Destroy(PooledObject obj, float delay = 0f)
        {
            ObjectPool pool = ObjectPoolManager.GetPool(obj);

            pool.DisableObject(obj, delay);
        }
예제 #3
0
 /// <summary>
 /// Initialize ObjectPool.
 /// (ObjectPool을 초기화합니다.)
 /// </summary>
 /// <param name="managedObject">The Object managed by this ObjectPool. (이 ObjectPool이 관리할 Object입니다.)</param>
 public void Initialize(PooledObject managedObject)
 {
     managedObject_ = managedObject;
 }
예제 #4
0
 public static PooledObject Instantiate(PooledObject original, Vector3 position, Quaternion rotation)
 {
     return(PooledObject.Instantiate(original, position, rotation, null));
 }
예제 #5
0
 public static void Destroy(PooledObject obj)
 {
     Destroy(obj, 0f);
 }
예제 #6
0
 public static PooledObject Instantiate(PooledObject original, Transform parent)
 {
     return(PooledObject.Instantiate(original, Vector3.zero, Quaternion.identity, parent));
 }
예제 #7
0
 // Normal Instantiate
 public static PooledObject Instantiate(PooledObject original)
 {
     return(PooledObject.Instantiate(original, Vector3.zero, Quaternion.identity, null));
 }
예제 #8
0
 public static new T Instantiate <T>(T original, Vector3 position, Quaternion rotation, Transform parent) where T : PooledObject
 {
     return(PooledObject.Instantiate((PooledObject)original, position, rotation, parent) as T);
 }
예제 #9
0
 public static new T Instantiate <T>(T original, Transform parent) where T : PooledObject
 {
     return(PooledObject.Instantiate((PooledObject)original, parent) as T);
 }
예제 #10
0
        ////////////////////////////////////////////////////
        ///// Instantiate and Destory for PooledObject /////
        ///// (PooledObject전용 Instantiate와 Destory)  /////
        ////////////////////////////////////////////////////

        // Generic Instantiate
        public static new T Instantiate <T>(T original) where T : PooledObject
        {
            return(PooledObject.Instantiate((PooledObject)original) as T);
        }