Beispiel #1
0
 private void UpdateTable()
 {
     for (int iPlayer = 0; iPlayer < GameManager.Singleton.numOfPlayer; ++iPlayer)
     {
         MoneyStat?stat = GameManager.Singleton.GetMoneyStat(iPlayer);
         if (stat != null)
         {
             if (stat.HasValue)
             {
                 Color             c   = stat.Value.color;
                 MoneyTableElement elm = elms[c];
                 elm.playerName.text     = stat.Value.name;
                 elm.playerColor.color   = new Color(c.r, c.g, c.b, elmAlpha);
                 elm.playerMoney.text    = stat.Value.money.ToString();
                 elm.playerMoneyLog.text = stat.Value.moenyLog;
             }
         }
     }
 }
Beispiel #2
0
    void Start()
    {
        tbCloseIcon.onClick += GameManager.Singleton.Response;

        for (int iPlayer = 0; iPlayer < GameManager.Singleton.numOfPlayer; ++iPlayer)
        {
            GameObject        prefab = ResourceManager.Singleton.LoadResource <GameObject>(elmPath);
            MoneyTableElement elm    = Instantiate(prefab, elmAnchor).GetComponent <MoneyTableElement>();
            MoneyStat?        stat   = GameManager.Singleton.GetMoneyStat(iPlayer);

            if (stat != null)
            {
                if (stat.HasValue)
                {
                    elm.playerName.text     = stat.Value.name;
                    elm.playerColor.color   = stat.Value.color;
                    elm.playerMoney.text    = stat.Value.money.ToString();
                    elm.playerMoneyLog.text = stat.Value.moenyLog;
                    elms.Add(elm.playerColor.color, elm);
                }
            }
        }
    }