Asteroid Belt Upgrade
Asteroids now use custom particle system with collider so they can be clicked, plus they now orbit at varying speeds! Fixed flags enum inspector; resources were being assigned to wrong body type: gas giants had planet resources, suns had gas giant resources, asteroids had nothing
This commit is contained in:
parent
ba681abeb6
commit
7c30a72c71
14 changed files with 516 additions and 202 deletions
|
|
@ -69,8 +69,8 @@ public static class Extensions
|
|||
private static Random? _random;
|
||||
private static Random Random => (Random) (_random ?? (_random = new Random((uint) (DateTime.Now.Ticks%uint.MaxValue))));
|
||||
// public static T RandomElement<T>(this IEnumerable<T> enumerable) => enumerable.ElementAt(Random.NextInt(0, enumerable.Count()));
|
||||
public static float NextUnbounded(this Random random) => 1 / (1 - random.NextFloat()) - 1;
|
||||
public static float NextUnbounded(this Random random, float bias, float power) => 1 / (1 - pow(random.NextFloat(), 1 - pow(clamp(bias,0,.99f), 1 / power))) - 1;
|
||||
public static float NextUnbounded(this ref Random random) => 1 / (1 - random.NextFloat()) - 1;
|
||||
public static float NextUnbounded(this ref Random random, float bias, float power) => 1 / (1 - pow(random.NextFloat(), 1 - pow(clamp(bias,0,.99f), 1 / power))) - 1;
|
||||
|
||||
private static Dictionary<Type,Type[]> InterfaceClasses = new Dictionary<Type, Type[]>();
|
||||
public static Type[] GetAllInterfaceClasses(this Type type)
|
||||
|
|
|
|||
Loading…
Reference in a new issue