Beispiel #1
0
 public void SubmenuAction()
 {
     if ((string)selected != "")
     {
         if (subMenuId == 0)
         {
             GameManager.PlayerStats stats = GameManager.GetPlayerStats();
             string[] newShips             = new string[stats.shipsOwned.Length - 1];
             bool     removed = false;
             int      i       = 0;
             foreach (string ship in stats.shipsOwned)
             {
                 if (removed || ship != (string)selected)
                 {
                     newShips[i] = ship;
                     i++;
                 }
                 else
                 {
                     removed = true;
                 }
             }
             stats.shipsOwned = newShips;
             GameManager.SetPlayerStats(stats);
             GameManager.instance.player.focused = ShipSO.shipTypes[(string)selected].Spawn(GameManager.instance.player.faction, station.shipSpawnpoint.position).GetComponent <Focusable>();
             GameManager.instance.UIBG.GoToScreen(6);
         }
     }
 }
Beispiel #2
0
    void Update()
    {
        string show = "";

        GameManager.PlayerStats stats = GameManager.GetPlayerStats();
        if (showMoney)
        {
            show += stats.money + "₪";
        }
        if (showLevel)
        {
            if (multiline)
            {
                show += "\n";
            }
            show += "Level " + stats.level;
        }
        display.text = show;
    }