private static string GetPilotTooltipImage(GameObject panel) { string pilotKey = panel.GetComponent <Dropdown>().captionText.text; GenericShip ship = (GenericShip)Activator.CreateInstance(Type.GetType(AllPilots.Find(n => n.PilotNameWithCost == pilotKey).PilotTypeName)); return(ship.ImageUrl); }
private static string GetImageOfIconicPilot(ShipRecord ship) { string image = null; if (ship.Instance.IconicPilots != null) { image = AllPilots.Find(n => n.PilotTypeName == ship.Instance.IconicPilots[CurrentSquadList.SquadFaction].ToString()).Instance.ImageUrl; } return(image); }
//Faction change //TODO: Change private static void CheckPlayerFactonChange(PlayerNo playerNo) { Faction playerFaction = GetPlayerFaction(playerNo); List <Transform> playerShips = new List <Transform>(); foreach (Transform shipPanel in GetShipsPanel(playerNo)) { playerShips.Add(shipPanel); } bool isFactionChanged = false; foreach (Transform shipPanel in playerShips) { if (shipPanel.name == "AddShipPanel") { continue; } string pilotName = shipPanel.Find("GroupShip/DropdownPilot").GetComponent <Dropdown>().captionText.text; GenericShip newPilot = (GenericShip)Activator.CreateInstance(Type.GetType(AllPilots.Find(n => n.PilotNameWithCost == pilotName).PilotTypeName)); if (newPilot.faction != playerFaction) { isFactionChanged = true; RemoveShip(playerNo, shipPanel.gameObject); } } if (isFactionChanged) { AddInitialShip(playerNo); } }
private static string GetNameOfPilot(SquadBuilderShip squadBuilderShip) { return(AllPilots.Find(n => n.PilotNameWithCost == squadBuilderShip.Panel.transform.Find("GroupShip/DropdownPilot").GetComponent <Dropdown>().captionText.text).PilotTypeName); }