public static void putToRecycle(ReuseableGameObject type, GameObject o, string customName = "") { o.transform.SetParent(GameManager.getGameManager().recyclePoolHolder.transform); o.transform.position = Vector3.zero; o.SetActive(false); getObjectPool(type + customName).Enqueue(o); }
public static GameObject spawnPrefab(GameObject prefab, Vector3 position, ReuseableGameObject ReuseableGameObject, string customName = "") { GameObject o = ReuseGameObjectHandler.getObject(ReuseableGameObject + "", position); if (o == null) { o = spawnPrefab(prefab, position); } return(o); }
public static List <Entity> getEntitiesByType(ReuseableGameObject ReuseableGameObject) { List <Entity> l; if (entityLists.TryGetValue(ReuseableGameObject, out l) == false) { l = new List <Entity>(); entityLists.Add(ReuseableGameObject, l); } return(l); }
public static List <Entity> getEntityInRadius(ReuseableGameObject ReuseableGameObject, Vector3 pos, float radius) { List <Entity> entities = new List <Entity>(); foreach (Entity e in GameManager.getEntitiesByType(ReuseableGameObject)) { if (e.reuseableGameObject == ReuseableGameObject) { if (Vector3.Distance(e.getLocation().getVector3(), pos) <= radius) { entities.Add(e); } } } return(entities); }
public List <Entity> getNearbyEntities(ReuseableGameObject ReuseableGameObject, float radius) { return(GameManager.getEntityInRadius(ReuseableGameObject, this.getLocation().getVector3(), radius)); }