コード例 #1
0
ファイル: SgtBeltAsteroid.cs プロジェクト: BackToGround/XGame
 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;
 }
コード例 #2
0
	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;
	}
コード例 #3
0
 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;
 }
コード例 #4
0
ファイル: SgtSimpleBelt.cs プロジェクト: BackToGround/XGame
    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);
    }
コード例 #5
0
    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);
    }
コード例 #6
0
ファイル: SgtCustomBelt.cs プロジェクト: BackToGround/XGame
 protected override void NextQuad(ref SgtBeltAsteroid asteroid, int asteroidIndex)
 {
     asteroid.CopyFrom(Asteroids[asteroidIndex]);
 }
コード例 #7
0
 protected abstract void NextQuad(ref SgtBeltAsteroid quad, int starIndex);