public void CopyFrom(SgtBeltAsteroid other) { Variant = other.Variant; Color = other.Color; Radius = other.Radius; Height = other.Height; Angle = other.Angle; Spin = other.Spin; OrbitAngle = other.OrbitAngle; OrbitSpeed = other.OrbitSpeed; OrbitDistance = other.OrbitDistance; }
public void CopyFrom(SgtBeltAsteroid other) { MainTex = other.MainTex; HeightTex = other.HeightTex; Color = other.Color; Radius = other.Radius; Angle = other.Angle; Spin = other.Spin; OrbitAngle = other.OrbitAngle; OrbitSpeed = other.OrbitSpeed; Height = other.Height; OrbitDistance = other.OrbitDistance; }
protected override void NextQuad(ref SgtBeltAsteroid asteroid, int asteroidIndex) { //var distance01 = Random.value; var distance01 = (Random.value + Random.value) * 0.5f; asteroid.Variant = Random.Range(int.MinValue, int.MaxValue); asteroid.Color = Color.white; asteroid.Radius = Mathf.Lerp(AsteroidRadiusMin, AsteroidRadiusMax, Mathf.Pow(Random.value, AsteroidRadiusBias)); asteroid.Height = Mathf.Pow(Random.value, ThicknessBias) * Thickness * (Random.value < 0.5f ? -0.5f : 0.5f); asteroid.Angle = Random.Range(0.0f, Mathf.PI * 2.0f); asteroid.Spin = Random.Range(-AsteroidSpin, AsteroidSpin); asteroid.OrbitAngle = Random.Range(0.0f, Mathf.PI * 2.0f); asteroid.OrbitSpeed = Mathf.Lerp(InnerSpeed, OuterSpeed, distance01); asteroid.OrbitDistance = Mathf.Lerp(InnerRadius, OuterRadius, distance01); }
protected override void NextQuad(ref SgtBeltAsteroid asteroid, int asteroidIndex) { var distance01 = Random.value; var offset = SpeedNoiseDistribution.Evaluate(distance01); asteroid.Variant = Random.Range(int.MinValue, int.MaxValue); asteroid.Color = Color.white; asteroid.Radius = RadiusDistribution.Evaluate(Random.value); asteroid.Height = HeightDistribution.Evaluate(Random.value); asteroid.Angle = Random.Range(0.0f, Mathf.PI * 2.0f); asteroid.Spin = SpinDistribution.Evaluate(Random.value); asteroid.OrbitAngle = Random.Range(0.0f, Mathf.PI * 2.0f); asteroid.OrbitSpeed = SpeedDistribution.Evaluate(distance01) + Random.Range(-offset, offset); asteroid.OrbitDistance = DistanceDistribution.Evaluate(distance01); }
protected override void NextQuad(ref SgtBeltAsteroid asteroid, int asteroidIndex) { asteroid.CopyFrom(Asteroids[asteroidIndex]); }
protected abstract void NextQuad(ref SgtBeltAsteroid quad, int starIndex);