public static UnityAppearanceStat FindStat(UnityPlanet p) { var appearancestat = p.GetComponentInChildren<UnityAppearanceStat>() as UnityAppearanceStat; appearancestat.AttackStat = appearancestat.transform.FindChild("Attack").GetComponent<TextMesh>(); appearancestat.DefenseStat = appearancestat.transform.FindChild("Defense").GetComponent<TextMesh>(); appearancestat.ProductivityStat = appearancestat.transform.FindChild("Productivity").GetComponent<TextMesh>(); appearancestat.ResearchStat = appearancestat.transform.FindChild("Research").GetComponent<TextMesh>(); appearancestat.NextShipIn = appearancestat.transform.FindChild("NextShipIn").GetComponent<TextMesh>(); return appearancestat; }
public static UnityStat FindStat(UnityPlanet p) { //var stat = p.GetComponentInChildren<UnityStat>() as UnityStat; var stat = p.transform.FindChild("Stat").GetComponent<UnityStat>() as UnityStat; stat.Enabled = true; stat.AttackStat = stat.transform.FindChild("Attack").GetComponent<TextMesh>(); stat.DefenseStat = stat.transform.FindChild("Defense").GetComponent<TextMesh>(); stat.ProductivityStat = stat.transform.FindChild("Productivity").GetComponent<TextMesh>(); stat.ResearchStat = stat.transform.FindChild("Research").GetComponent<TextMesh>(); stat.NextShipIn = stat.transform.FindChild("NextShipIn").GetComponent<TextMesh>(); stat.Owner = stat.transform.FindChild("OwnerText").GetComponent<TextMesh>(); stat.ShipCount = stat.transform.FindChild("ShipCountText").GetComponent<TextMesh>(); return stat; }
public Planet(UnityPlanet p) {JustEntered = false; frame = World.frame; UnityPlanet = p; Targeted = false; }
public Planet(GameConstants constants, UnityPlanet p, List<Tuple<UnityPlanet, UnityPlanet>> n, Option<Commander> c) {JustEntered = false; frame = World.frame; UnityPlanet = p; Targeted = false; StarSystem = (new Nothing<StarSystem>()); ShipsToForward = ( Enumerable.Empty<Ship>()).ToList<Ship>(); ShipToSend = ( Enumerable.Empty<TravelingShip>()).ToList<TravelingShip>(); Selected = false; PlanetStats = (new Nothing<PlanetInfo>()); Owner = c; Neighbours = n; LandingShips = ( Enumerable.Empty<LandingShip>()).ToList<LandingShip>(); LandedShips = 0; InboundShips = ( Enumerable.Empty<Ship>()).ToList<Ship>(); Constants = constants; Battle = (new Nothing<Battle>()); Auto_Hop_Timer = false; ActiveHopsCounter = 0; }
public static List<Tuple<UnityPlanet, UnityPlanet>> getHopTable(UnityPlanet p, List<UnityPlanet> planets) { int index = planets.IndexOf(p); List<Tuple<UnityPlanet, UnityPlanet>> hops = new List<Tuple<UnityPlanet, UnityPlanet>>(); for (int i = 0; i < planets.Count; i++) { hops.Add(new Tuple<UnityPlanet, UnityPlanet>(planets[i], nextHop[index, i])); } return hops; }
public static void Revolute(UnityPlanet planet, Vector3 origin, float angle) { planet.gameObject.transform.RotateAround(origin,Vector3.up,angle); }
public Planet(UnityPlanet up, GameStatistic statistics, Option<Player> owner) {JustEntered = false; frame = World.frame; UnityPlanet = up; Statistics = statistics; Owner = owner; MinApproachingDist = 0.5f; LocalFleets = 0; LandingFleets = ( Enumerable.Empty<LandingFleet>()).ToList<LandingFleet>(); InboundFleets = ( Enumerable.Empty<Fleet>()).ToList<Fleet>(); Battle = (new Nothing<Battle>()); }