Beispiel #1
0
    public void Refresh()
    {
        Util.SetText(nameText, Data.info.name);
        Util.SetText(desc, Data.info.desc);
        Util.SetText(costNumber, Data.info.cost.ToString());
        Util.SetText(symbol, Util.GetChargeCurrencySymbol((ChargeCurrencyTypes)Data.info.currencyType));
        Util.SetText(remainTime,
                     Util.Format(ConfigText.GetDefalutString(TextForMatType.RechargeUIText, 2),
                                 Util.GetTimeStampDiff((int)Data.info.endTime, true)));
        Util.SetText(limitLevel,
                     Util.Format(ConfigText.GetDefalutString(TextForMatType.RechargeUIText, 3), Data.info.minLevelLimit,
                                 Data.info.maxLevelLimit));

        remainTime.SafeSetActive(Data.info.endTime > 0);
        limitLevel.SafeSetActive(Data.info.maxLevelLimit > 0);

        if (!string.IsNullOrEmpty(Data.info.icon))
        {
            AtlasHelper.SetChargeLarge(icon, Data.info.icon);
        }
        else
        {
            icon.SafeSetActive(false);
            Logger.LogError($"{Data.info.name} 无效的道具图标 {Data.info.icon}");
        }

        RefreshCount();
    }
    public void InitData(PGrowthFund item)
    {
        Init();

        Data = item;
        if (Data == null)
        {
            return;
        }

        if (Module_Player.instance.level >= item.level)
        {
            SetState(Data.draw ? State.Got : State.CanGot);
        }
        else
        {
            SetState(State.Process);
        }

        if (!string.IsNullOrEmpty(Data.icon))
        {
            AtlasHelper.SetChargeLarge(bigIcon, Data.icon);
        }

        Util.SetText(title, Util.Format(ConfigText.GetDefalutString(TextForMatType.RechargeUIText, 1), Data.level));
        Util.SetText(desc, Data.desc);
    }
Beispiel #3
0
    public void UpdateItemInfo()
    {
        if (item?.info == null)
        {
            return;
        }

        Util.SetText(desc, item.info.desc);
        Util.SetText(number, item.info.cost.ToString());
        Util.SetText(symbol, Util.GetChargeCurrencySymbol((ChargeCurrencyTypes)item.info.currencyType));
        if (!string.IsNullOrEmpty(item.info.icon))
        {
            AtlasHelper.SetChargeLarge(bigIcon, item.info.icon);
        }
        Util.SetText(gotNumber, item.info.reward.diamond.ToString());
        doubleReward?.SafeSetActive(item.TotalBuyTimes() == 0);
    }
    private void Refresh()
    {
        if (m_day > m_info.id)
        {
            SetState(m_info.draw ? State.Got : State.Overdue);
        }
        else if (m_day == m_info.id)
        {
            SetState(m_info.draw ? State.Got : State.CanGot);
        }
        else
        {
            SetState(State.Process);
        }

        if (!string.IsNullOrEmpty(m_info.icon))
        {
            AtlasHelper.SetChargeLarge(bigIcon, m_info.icon);
        }

        Util.SetText(title, Util.Format(ConfigText.GetDefalutString(TextForMatType.RechargeUIText, 25), m_info.id));
        Util.SetText(desc, m_info.desc);
    }
    public void InitData(PTotalCostReward item)
    {
        Data = item;
        if (Data == null)
        {
            return;
        }
        if (Module_Charge.instance.totalCost >= item.total)
        {
            SetState(Data.draw ? State.Got : State.CanGot);
        }
        else
        {
            SetState(State.Process);
        }

        if (!string.IsNullOrEmpty(Data.icon))
        {
            AtlasHelper.SetChargeLarge(icon, Data.icon);
        }
        Util.SetText(title, Util.Format(ConfigText.GetDefalutString(TextForMatType.RechargeUIText, 6), Data.total));
        Util.SetText(desc, Data.desc);

        detail?.onClick.RemoveAllListeners();
        detail?.onClick.AddListener(() =>
        {
            onShowDetail?.Invoke(this);
        });

        mainBody?.onClick.RemoveAllListeners();
        mainBody?.onClick.AddListener(() =>
        {
            onClick?.Invoke(this);
            selected = true;
        });
    }