public void GenerateProperties() { GalaxyManager gm = GameObject.Find("Camera").GetComponent <GalaxyManager>(); int[] planetSA = new int[gm.noPlanets]; int million = 1000000; for (int i = 0; i < gm.noPlanets; i++) { switch (gm.GetPlanetByIndex(i)._Scale) { case (1): planetSA[i] = 350 * million; break; case (1.5f): planetSA[i] = 500 * million; break; case (2): planetSA[i] = 800 * million; break; } int j; int areaAllowance = planetSA[i]; while (areaAllowance > 0) { } } }
private int CalculateRouteChangeStateTurns(int a, int b, bool isOpen) { int changeStateTurns = 0; // GET CURRENT POSITIONS OF A AND B Vector3 A = gm.GetPlanetByIndex(a)._GameObject.transform.position; Vector3 B = gm.GetPlanetByIndex(b)._GameObject.transform.position; // WHILE A -> B IS IN THE SAME STATE, INCREMENT A COUNTER while (LineHitsSunCollider(A, B, a) == !isOpen) { A = IncOrbitTest(A, a); B = IncOrbitTest(B, b); changeStateTurns++; } return(changeStateTurns); }
void OnMouseEnter() { string routeName = this.GetComponentInParent <Transform>().name; a = (int)Char.GetNumericValue(routeName[routeName.Length - 2]); b = (int)Char.GetNumericValue(routeName[routeName.Length - 1]); Debug.Log("a is " + a + " b is " + b); A = gm.GetPlanetByIndex(a)._GameObject.transform.position; B = gm.GetPlanetByIndex(b)._GameObject.transform.position; Debug.Log("A is " + A + "B is " + B); if (gm.TradeLinesOn == false && !gm.LMLineHitsSunCollider(A, B, a)) { gm.LMActivateLine(A, B, a); } }