public void Init(LocalSave.TimeBoxType type, int now, int old)
    {
        CurrencyType diamondBoxNormal = CurrencyType.DiamondBoxNormal;

        if (type == LocalSave.TimeBoxType.BoxChoose_DiamondLarge)
        {
            diamondBoxNormal = CurrencyType.DiamondBoxLarge;
        }
        this.Image_Extra.set_sprite(SpriteManager.GetUICommonCurrency(diamondBoxNormal));
        int timeBoxCount = LocalSave.Instance.GetTimeBoxCount(type);

        this.mRedNodeCtrl.SetType(RedNodeType.eRedCount);
        this.mRedNodeCtrl.Value        = timeBoxCount;
        this.rect_old.anchoredPosition = new Vector2(0f, this.old_y);
        this.rect_now.anchoredPosition = new Vector2(0f, this.now_y);
        this.Text_RetryNotFree.get_rectTransform().anchoredPosition = new Vector2(0f, this.retry_y);
        this.freeparent.SetActive(false);
        this.notfreeparent.SetActive(false);
        this.extraparent.SetActive(false);
        if (timeBoxCount > 0)
        {
            this.freeparent.SetActive(true);
        }
        else
        {
            int diamondExtraCount = 0;
            diamondExtraCount = LocalSave.Instance.GetDiamondExtraCount(type);
            if (diamondExtraCount > 0)
            {
                this.extraparent.SetActive(true);
                object[] args = new object[] { diamondExtraCount };
                this.Text_Extra.text = Utils.FormatString("{0}/1", args);
            }
            else
            {
                this.notfreeparent.SetActive(true);
                if (now == old)
                {
                    this.Text_RetryNotFree.get_rectTransform().anchoredPosition = new Vector2(0f, 20f);
                    this.rect_now.anchoredPosition = new Vector2(0f, this.old_y);
                    this.mGoldOld.gameObject.SetActive(false);
                }
                else
                {
                    this.mGoldNow.gameObject.SetActive(true);
                    this.mGoldOld.gameObject.SetActive(true);
                }
                this.mGoldNow.SetValue(now);
                this.mGoldOld.SetValue(old);
            }
        }
    }
Exemple #2
0
 public void Init(LocalSave.TimeBoxType type)
 {
     this.chooseType = type;
     if ((type == LocalSave.TimeBoxType.BoxChoose_DiamondNormal) || (type == LocalSave.TimeBoxType.BoxChoose_DiamondLarge))
     {
         this.Text_Get.text = GameLogic.Hold.Language.GetLanguageByTID("BoxChoose_Name1", Array.Empty <object>());
     }
     else
     {
         this.Text_Get.text = GameLogic.Hold.Language.GetLanguageByTID("BoxChoose_Name10", Array.Empty <object>());
     }
     this.needgold = GameConfig.GetBoxChooseGold(this.chooseType);
     this.mGoldCtrl.SetValue(this.needgold);
     this.SetTextGetShow(false);
     this.SetFreeTimeShow(false);
     this.SetGoldShow(true);
     this.needtime = GameConfig.GetBoxChooseTime(this.chooseType);
     this.UpdateBoxChooseTime();
 }
Exemple #3
0
    public void Play(BoxState state, LocalSave.TimeBoxType type)
    {
        string str  = state.ToString();
        string str2 = string.Empty;

        if (type == LocalSave.TimeBoxType.BoxChoose_DiamondNormal)
        {
            str2 = "eNormal";
            this.Image_Down.set_sprite(SpriteManager.GetUICommon("UICommon_Box02_Down"));
        }
        else if (type == LocalSave.TimeBoxType.BoxChoose_DiamondLarge)
        {
            str2 = "eLarge";
            this.Image_Down.set_sprite(SpriteManager.GetUICommon("UICommon_Box01_Down"));
        }
        object[] args      = new object[] { str, str2 };
        string   stateName = Utils.FormatString("{0}_{1}", args);

        this.Ani_Box.Play(stateName);
    }
 public static long GetBoxChooseTime(LocalSave.TimeBoxType type) =>
 LocalModelManager.Instance.Config_config.GetValue <long>(((int)type) + 10);
 public static int GetBoxChooseGold(LocalSave.TimeBoxType type) =>
 LocalModelManager.Instance.Config_config.GetValue <int>((int)type);
 public static int GetTimeBoxTime(LocalSave.TimeBoxType type) =>
 GetValue <int>(((int)type) + 10);