Ejemplo n.º 1
0
    private void SetData()
    {
        MoneyLabel.text     = ItemManager.Instance.Money.ToString();
        NameLabel.text      = _selectedEquip.Name;
        CommentLabel.text   = _selectedEquip.Comment;
        NeedMoneyLabel.text = "價格:" + _selectedEquip.UpgradePrice;
        if (_selectedEquip.Owner != string.Empty)
        {
            OwnerLabel.text = "持有者:" + _selectedEquip.Owner;
        }
        else
        {
            OwnerLabel.text = string.Empty;
        }
        EquipComment.gameObject.SetActive(true);
        EquipComment.SetData(_selectedEquip);
        UpgradeButton.gameObject.SetActive(true);

        _canUpgrade = true;

        if (ItemManager.Instance.Money < _selectedEquip.UpgradePrice)
        {
            _canUpgrade = false;
            _tipText    = "錢不足";
        }

        if (_selectedEquip.Lv == Equip.MaxLv)
        {
            _canUpgrade = false;
            _tipText    = "已達等級上限";
        }

        if (_canUpgrade)
        {
            UpgradeButton.SetColor(Color.white);
        }
        else
        {
            UpgradeButton.SetColor(Color.grey);
        }
    }