Ejemplo n.º 1
0
        public static bool TryGetNearest(Vector2 position, out ResourcesSource source)
        {
            source = null;

            if (Sources.Count == 0)
            {
                return(false);
            }

            source = Sources.OrderBy(resourcesSource => Vector2.Distance(position, resourcesSource.transform.position))
                     .First();

            return(true);
        }
Ejemplo n.º 2
0
 internal static void RemoveSource(ResourcesSource source)
 {
     Sources.Remove(source);
 }
Ejemplo n.º 3
0
 internal static void AddSource(ResourcesSource source)
 {
     Sources.Add(source);
     OnResourcesCreated?.Invoke();
 }