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; }
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); }
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); }
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); } }
public SunSystemUpdater(SunBehaviour sun, PlanetBehaviour[] planets) { this.bodies = new SpaceBody[] { sun }.Concat(planets).ToArray(); }
// Use this for initialization void Start () { sun = GameObject.Find ("Sun").GetComponent<SunBehaviour> (); }
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); }