Ejemplo n.º 1
0
 public override void Refresh(HangarShip ship)
 {
     ShipName.text = ship.Ship.name;
     shipType      = ship.Type;
     if (ship.Bought == true)
     {
         if (ship.Used)
         {
             StatusMessage("Used");
         }
         else
         {
             StatusMessage("Bought");
         }
     }
     else
     {
         string costScrap = "Buy for " + ship.Ship.CostScrap + " Scrap";
         string costMetal = "Buy for " + ship.Ship.CostMetal + " Metal";
         if (GameData.LocalPlayer.Level >= ship.Ship.Level)
         {
             ButtonText(true, costScrap, costMetal);
             StatusMessage("Available");
         }
         else
         {
             ButtonText(false, costScrap, costMetal);
             StatusMessage("Required level " + ship.Ship.Level);
         }
     }
 }
Ejemplo n.º 2
0
 private void CreateShipInList(HangarShip ship, bool upgrade)
 {
     if (upgrade)
     {
         GameObject go = Instantiate(ShipInListWithBuyPrefab, ShipList);
         go.GetComponent <ShipInListWithBuy>().Refresh(ship);
         ButtonListener(go.AddComponent <Button>(), go.GetComponent <ShipInListWithBuy>().SwitchShip);
     }
     else
     {
         GameObject go = Instantiate(ShipInListPrefab, ShipList);
         go.GetComponent <ShipInList>().Refresh(ship);
         ButtonListener(go.AddComponent <Button>(), go.GetComponent <ShipInList>().SwitchShip);
     }
 }
Ejemplo n.º 3
0
 public virtual void Refresh(HangarShip ship)
 {
     ShipName.text = ship.Ship.name;
     shipType      = ship.Type;
     if (ship.Bought == true)
     {
         if (ship.Used)
         {
             StatusMessage("Used");
         }
         else
         {
             StatusMessage("Bought");
         }
     }
     else
     {
         StatusMessage("Required level " + ship.Ship.Level);
     }
 }
Ejemplo n.º 4
0
    private void CreateUsedShip(HangarShip hangar)
    {
        ShipName.text = hangar.Ship.Name;
        //ShipImage
        if (hangar.UpgradeHitpoints.Count > 0)
        {
            CreatePrefabWithUpgrade(Upgrades.Hitpoints, hangar);
        }
        else
        {
            CreatePrefabWithoutUpgrade(Upgrades.Hitpoints, hangar.Ship.MaxHitpoints);
        }

        if (hangar.UpgradeSpeed.Count > 0)
        {
            CreatePrefabWithUpgrade(Upgrades.Speed, hangar);
        }
        else
        {
            CreatePrefabWithoutUpgrade(Upgrades.Speed, hangar.Ship.Speed);
        }
    }
Ejemplo n.º 5
0
    private void CreatePrefabWithUpgrade(Upgrades upgrade, HangarShip hangar)
    {
        GameObject go = Instantiate(StatisticWithUpgradePrefab, ShipStatistics);

        go.GetComponent <StatisticWithUpgrade>().SetUpgrades(upgrade, hangar);
    }
Ejemplo n.º 6
0
 public void SetUpgrades(Upgrades upgradeType, HangarShip hangar)
 {
     UpgradeType = upgradeType;
     Hangar      = hangar;
     Refresh();
 }