コード例 #1
0
        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);
        }
コード例 #2
0
 public static int instance_number(Type obj)
 {
     return(SceneObjects.FindAll(x => x.OriginalType == obj).Count);
 }
コード例 #3
0
 public List <SceneObject> Find(Func <SceneObject, bool> filter)
 {
     return(SceneObjects.FindAll((x) => { return filter(x); }));
 }