Example #1
0
 public void Init(SubPool subPool, PooledObjectInfo objInf)
 {
     m_SubPool = subPool;
     m_ObjInf  = objInf;
     if (!IsInited)
     {
         return;
     }
     m_ObjInf.OnSpawnEvent   += OnSpawnMethod;
     m_ObjInf.OnDespawnEvent += OnDespawnMethod;
 }
Example #2
0
 public PooledObjectInfo(GameObject obj, string key, SubPool subPool)
 {
     Obj = obj;
     Key = key;
     obj.GetComponentsInChildren <IPooledComponent>(true, m_Pcs);
     m_Bcn = obj.AddComponent <PooledBeacon>();
     m_Bcn.Init(subPool, this);
     foreach (var pc in m_Pcs)
     {
         pc.Init(m_Bcn);
     }
 }