コード例 #1
0
ファイル: YGUISystem.cs プロジェクト: yakolla/MarineVsAlien
        void displayPrice(GUIOverlappedImageButton button, RefPrice[] prices, float itemWorth)
        {
            if (prices == null)
                return;

            int priceIndex = 0;
            foreach(RefPrice price in prices)
            {
                RefItem condRefItem = RefData.Instance.RefItems[price.refItemId];

                string str = "<color=white>";
                int cost = (int)(price.count*itemWorth);

                ItemObject inventoryItemObj = Warehouse.Instance.FindItem(price.refItemId);
                long hasCount = 0;
                if (inventoryItemObj == null)
                {
                    str = "<color=red>";
                }
                else if (inventoryItemObj != null)
                {
                    if (inventoryItemObj.Item.Count < cost)
                    {
                        str = "<color=red>";
                    }
                    hasCount = inventoryItemObj.Item.Count;
                }
                //str += hasCount;
                //str += "/" + cost;
                str += cost;
                str += "</color>";
                button.GUIImages[priceIndex].Lable.Text.text = str;

                ++priceIndex;
            }
        }
コード例 #2
0
ファイル: YGUISystem.cs プロジェクト: yakolla/MarineVsAlien
 public GUIPriceButton(GameObject obj, int startImagePosY, System.Func<bool> enableChecker)
 {
     m_button = new GUIOverlappedImageButton(obj, startImagePosY, enableChecker);
 }