public static GameObject instance_nearset(Vector2 position, Type obj, bool countMe = false) { List <GameObject> selectedObjects = SceneObjects.FindAll(x => x.OriginalType == obj); if (selectedObjects.Count > 0) { return(selectedObjects.OrderBy(x => point_distance(x.Position, position)).ToList()[0]); } return(null); }
public static int instance_number(Type obj) { return(SceneObjects.FindAll(x => x.OriginalType == obj).Count); }
public List <SceneObject> Find(Func <SceneObject, bool> filter) { return(SceneObjects.FindAll((x) => { return filter(x); })); }