public void RegenerateFleetShipNames() { FleetShipNames = ""; StringBuilder sb = new StringBuilder(); if (Ships.Count > 0) { foreach (StrategicShip s in Ships) { sb.AppendLine(s.DesignClass.HullDesignation.Prefix + " " + s.ShipName); if (s.isDamaged) { sb.Append(" [D]"); } } } else { for (int i = 1; i < 40; i++) { sb.AppendLine(HullDes.DesDictionary[HullDes.HullTypes[Random.Range(0, 2)]].Prefix + " " + NameManager.GrabShipName()); } } FleetShipNames = sb.ToString(); StrategicUIManager.UpdateUI(); }
public void IssueMovementCommand(Vector3 vec) { try{ Agent.SetDestination(new Vector3(vec.x, transform.position.y, vec.z)); } catch { Debug.Log("No agent assigned"); } StrategicUIManager.UpdateUI(); }
void HandleShields() { if (!ShieldsUp) { ShieldStrength = 0f; } else if (ShieldStrength < 1f) { ShieldStrength += 1f / TurnsToRaiseShields; } //literally impossible but we'll cover for it if (ShieldStrength > 1f) { ShieldStrength = 1f; } StrategicUIManager.UpdateUI(); }
void OnTriggerEnter(Collider col) { if (col.GetComponent <Fleet> ()) { Fleet f = col.GetComponent <Fleet> (); if (FactionMatrix.IsHostile(Faction, f.Faction)) { EnemyClose.Add(f); if (!pause) { PromptAction(); } } else if (Faction == f.Faction) { FriendlyClose.Add(f); } } NearbyGameObjects.Add(col.gameObject); StrategicUIManager.UpdateUI(); }
void PromptAction() { StrategicUIManager.UpdateUI(); StrategicClock.RequestPause(); }
public void SortShipsType() { RegenerateFleetShipNames(); Ships = Ships.OrderBy(s => s.DesignClass.HullDesignation.Prefix).ThenBy(s => s.DesignClass.DesignName).ToList(); StrategicUIManager.UpdateUI(); }
public void SortShipsMass() { RegenerateFleetShipNames(); Ships = Ships.OrderByDescending(s => s.Mass).ThenBy(s => s.DesignClass.DesignName).ToList(); StrategicUIManager.UpdateUI(); }
void Awake() { Manager = this; StrategicClock.PhaseChange.AddListener(TurnManagement); }