Наследование: MonoBehaviour
Пример #1
0
 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;
 }
Пример #2
0
 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;
 }
Пример #3
0
public Planet(UnityPlanet p)
	{JustEntered = false;
 frame = World.frame;
		UnityPlanet = p;
		Targeted = false;
		
}
Пример #4
0
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;
		
}
Пример #5
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;
  }
Пример #6
0
	public static void Revolute(UnityPlanet planet, Vector3 origin, float angle)
	{
		planet.gameObject.transform.RotateAround(origin,Vector3.up,angle);
	}
Пример #7
0
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>());
		
}