Beispiel #1
0
        private void Create(string type, string dir, int count = 5)
        {
            ObjectPoolEntry objectPoolEntry = new ObjectPoolEntry();
            GameObject      obj             = Resources.Load(dir + type) as GameObject;

            if (obj != null)
            {
                objectPoolEntry.Prefab = obj;
                objectPoolEntry.Count  = count;
                objectPoolEntry.name   = obj.name;

                objectPoolModel.AddObjectPoolEntry(objectPoolEntry);
            }
        }
Beispiel #2
0
 public void AddObjectPoolEntry(ObjectPoolEntry objectPoolEntry)
 {
     Entries.Add(objectPoolEntry);
 }