Пример #1
0
    void GenerateEnvironment(Vector3 center, SunSystem sunSystem)
    {
        List <SpaceBody> spaceBodies = new List <SpaceBody>();

        BattleGenerator.GenerateGalaxy(center, sunSystem, navigation, spaceBodies, AP);
        otherObjects.Add(new SunSystemUpdater(spaceBodies));
        sun = spaceBodies.First(b => b is SunBehaviour) as SunBehaviour;
    }
Пример #2
0
    void InitializePlanet(SunBehaviour sun, Vector3 axis, float radius)
    {
        transform.localScale = Vector3.one * radius;
        this.radius          = radius;

        AddMyComponent <SatelliteBehaviour>()
        .SetSun(sun.transform, sun.radius, axis);

        ships = new ShipList(this, axis, .05f);
    }
Пример #3
0
    IEnumerator AsyncInitialize(SunBehaviour sun, Vector3 axis, float radius)
    {
        InitializePlanet(sun, axis, radius);
        Color[] texture = null;
        yield return(new AsyncProcess(() => {
            texture = GenerateTexture(texture_width, texture_height);
        }
                                      ).Process());

        SetTexture(texture, texture_width, texture_height);
    }
Пример #4
0
 public void Initialize(SunBehaviour sun, Vector3 axis, float radius, AsyncProcessor asyncProcessor)
 {
     if (asyncProcessor != null)
     {
         asyncProcessor.Process(() => AsyncInitialize(sun, axis, radius));
     }
     else
     {
         Initialize(sun, axis, radius);
     }
 }
Пример #5
0
 public SunSystemUpdater(SunBehaviour sun, PlanetBehaviour[] planets)
 {
     this.bodies = new SpaceBody[] { sun }.Concat(planets).ToArray();
 }
Пример #6
0
	// Use this for initialization
	void Start () {
		sun = GameObject.Find ("Sun").GetComponent<SunBehaviour> ();
	}
Пример #7
0
 public void Initialize(SunBehaviour sun, Vector3 axis, float radius)
 {
     InitializePlanet(sun, axis, radius);
     Color[] texture = GenerateTexture(texture_width, texture_height);
     SetTexture(texture, texture_width, texture_height);
 }