Exemplo n.º 1
0
        private void LockView(UnitData unitData, TobiraParam tobiraParam)
        {
            this.TobiraOpenButtonText.set_text(string.Format(LocalizedText.Get("sys.TOBIRA_INVENTORY_OPEN_TITLE"), (object)TobiraParam.GetCategoryName(tobiraParam.TobiraCategory)));
            this.mLockedLayout.SetActive(true);
            this.mTobiraConditionsLayout.SetActive(true);
            this.mUnlockedLayout.SetActive(false);
            this.mTobiraMasterBonusLayout.SetActive(false);
            this.mTobiraMasterEbaleLayout.SetActive(false);
            bool isEnable = TobiraUtility.IsClearAllToboraConditions(unitData, tobiraParam.TobiraCategory);

            ((Selectable)this.TobiraOpenButton.GetComponent <Button>()).set_interactable(isEnable);
            UnitTobiraParamWindow.SetHilightAnimationEnable(this.TobiraOpenButton, isEnable);
        }
Exemplo n.º 2
0
        public void Refresh()
        {
            Button component = (Button)((Component)this).GetComponent <Button>();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)component, (UnityEngine.Object)null) || this.mCategory <= TobiraParam.Category.START || TobiraParam.Category.MAX <= this.mCategory)
            {
                ((Component)this).get_gameObject().SetActive(false);
            }
            this.TobiraEnableImages.ImageIndex  = (int)(this.mCategory - 1);
            this.TobiraDisableImages.ImageIndex = (int)(this.mCategory - 1);
            this.mParam = MonoSingleton <GameManager> .Instance.MasterParam.GetTobiraParam(this.mUnit.UnitID, this.mCategory);

            if (this.mParam == null || !this.mParam.Enable)
            {
                ((Selectable)component).set_interactable(false);
                this.LockGO.SetActive(true);
            }
            else
            {
                TobiraData tobiraData = this.mUnit.TobiraData.Find((Predicate <TobiraData>)(tobira => tobira.Param.TobiraCategory == this.mCategory));
                bool       flag       = tobiraData != null && tobiraData.IsUnlocked;
                if (!flag)
                {
                    bool isEnable = TobiraUtility.IsClearAllToboraConditions(this.mUnit, this.mCategory);
                    this.DisableGO.SetActive(true);
                    this.SetHilightAnimationEnable(isEnable);
                    this.EnableGO.SetActive(false);
                }
                else
                {
                    this.DisableGO.SetActive(false);
                    this.SetHilightAnimationEnable(false);
                    this.EnableGO.SetActive(true);
                }
                if (this.LevelIconGOList == null || this.LevelIconGOList.Length == 0 || !flag)
                {
                    return;
                }
                for (int index = 0; index < this.LevelIconGOList.Length; ++index)
                {
                    if (!UnityEngine.Object.op_Equality((UnityEngine.Object) this.LevelIconGOList[index], (UnityEngine.Object)null))
                    {
                        this.LevelIconGOList[index].SetActive(index < tobiraData.ViewLv);
                    }
                }
            }
        }