Exemplo n.º 1
0
        public void SetupLevelupAnimation()
        {
            int mixTotalExp;
            int mixTrustExp;
            int mixTotalAwakeLv;

            ConceptCardManager.CalcTotalExpTrust(this.SelectedConceptCardData, this.SelectedMaterials, out mixTotalExp, out mixTrustExp, out mixTotalAwakeLv);
            this.mLevelObject.SetupLevelupAnimation(mixTotalExp, mixTrustExp);
        }
Exemplo n.º 2
0
        private void RefreshIcons(MultiConceptCard drawicons, MultiConceptCard materials)
        {
            if (drawicons == null)
            {
                return;
            }
            ConceptCardManager ccManager = this.CCManager;
            bool AcceptableExp           = true;
            bool AcceptableTrust         = true;
            bool flag = true;

            if (this.mListType == ConceptCardList.ListType.ENHANCE && ccManager.SelectedConceptCardData != null)
            {
                int mixTotalExp;
                int mixTrustExp;
                int mixTotalAwakeLv;
                ConceptCardManager.CalcTotalExpTrust(ccManager.SelectedConceptCardData, materials, out mixTotalExp, out mixTrustExp, out mixTotalAwakeLv);
                AcceptableExp   = mixTotalExp < ccManager.SelectedConceptCardData.GetExpToLevelMax();
                AcceptableTrust = mixTrustExp < ccManager.SelectedConceptCardData.GetTrustToLevelMax();
                if (ccManager.SelectedConceptCardData.GetReward() == null)
                {
                    AcceptableTrust = false;
                }
                if ((int)ccManager.SelectedConceptCardData.AwakeCount >= ccManager.SelectedConceptCardData.AwakeCountCap)
                {
                    flag = false;
                }
            }
            for (int index1 = 0; index1 < this.mCardIcons.Count; ++index1)
            {
                int index2 = this.mPage * this.mPageSize + index1;
                this.mCardIcons[index1].SetActive(true);
                ConceptCardIcon component1 = (ConceptCardIcon)this.mCardIcons[index1].GetComponent <ConceptCardIcon>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component1, (UnityEngine.Object)null))
                {
                    component1.Setup(drawicons.GetItem(index2));
                }
                if (0 <= index2 && index2 < drawicons.Count)
                {
                    ConceptCardIconMultiSelect component2 = (ConceptCardIconMultiSelect)this.mCardIcons[index1].GetComponent <ConceptCardIconMultiSelect>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component2, (UnityEngine.Object)null))
                    {
                        bool CanAwake = true;
                        if (this.mListType == ConceptCardList.ListType.ENHANCE && ccManager.SelectedConceptCardData != null)
                        {
                            CanAwake = flag && ccManager.SelectedConceptCardData.Param.iname == component2.ConceptCard.Param.iname;
                        }
                        this.RefreshSelectParam(component2, materials);
                        this.RefreshEnableParam(component2, materials, AcceptableExp, AcceptableTrust, CanAwake);
                    }
                }
            }
        }
Exemplo n.º 3
0
 public static void CalcTotalExpTrust(out int mixTotalExp, out int mixTrustExp, out int mixTotalAwakeLv)
 {
     if (UnityEngine.Object.op_Equality((UnityEngine.Object)ConceptCardManager.Instance, (UnityEngine.Object)null))
     {
         mixTotalExp     = 0;
         mixTrustExp     = 0;
         mixTotalAwakeLv = 0;
     }
     else
     {
         ConceptCardManager.CalcTotalExpTrust(ConceptCardManager.Instance.SelectedConceptCardData, ConceptCardManager.Instance.SelectedMaterials, out mixTotalExp, out mixTrustExp, out mixTotalAwakeLv);
     }
 }
Exemplo n.º 4
0
        private void RefreshEnableParam(ConceptCardIconMultiSelect drawicons, MultiConceptCard materials, bool AcceptableExp, bool AcceptableTrust, bool CanAwake)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object)drawicons, (UnityEngine.Object)null))
            {
                return;
            }
            bool enable = true;

            if (!materials.IsSelected(drawicons.ConceptCard))
            {
                UnitData unitData = MonoSingleton <GameManager> .Instance.Player.Units.Find((Predicate <UnitData>)(u =>
                {
                    if (u.ConceptCard != null)
                    {
                        return((long)u.ConceptCard.UniqueID == (long)drawicons.ConceptCard.UniqueID);
                    }
                    return(false);
                }));

                if (materials.Count >= this.MAX_MULTI_SELECT || drawicons.ConceptCard.Favorite || unitData != null)
                {
                    enable = false;
                }
                else if (this.CCManager.SelectedConceptCardData != null)
                {
                    MultiConceptCard materials1 = new MultiConceptCard();
                    materials1.Add(drawicons.ConceptCard);
                    int mixTotalExp;
                    int mixTrustExp;
                    int mixTotalAwakeLv;
                    ConceptCardManager.CalcTotalExpTrust(this.CCManager.SelectedConceptCardData, materials1, out mixTotalExp, out mixTrustExp, out mixTotalAwakeLv);
                    if ((0 >= mixTotalExp || !AcceptableExp) && (0 >= mixTrustExp || !AcceptableTrust) && !CanAwake)
                    {
                        enable = false;
                    }
                }
            }
            if (this.mListType == ConceptCardList.ListType.SELL && drawicons.ConceptCard.Param.not_sale)
            {
                drawicons.SetNotSellFlag(true);
                enable = false;
            }
            else
            {
                drawicons.SetNotSellFlag(false);
            }
            drawicons.RefreshEnableParam(enable);
        }
Exemplo n.º 5
0
        private void RefreshTextExpAndTrust()
        {
            int mixTotalExp;
            int mixTrustExp;
            int mixTotalAwakeLv;

            ConceptCardManager.CalcTotalExpTrust(this.CCManager.SelectedConceptCardData, this.mSelectedMaterials, out mixTotalExp, out mixTrustExp, out mixTotalAwakeLv);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TextExp, (UnityEngine.Object)null))
            {
                this.TextExp.set_text(mixTotalExp.ToString());
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.TextTrust, (UnityEngine.Object)null))
            {
                return;
            }
            this.TextTrust.set_text(ConceptCardManager.ParseTrustFormat(mixTrustExp));
        }
Exemplo n.º 6
0
        public void SetConceptCardData(ConceptCardData data, GameObject ability_detail_parent, bool bEnhance, bool is_first_get_unit = false, UnitData unitData = null)
        {
            this.mConceptCardData = data;
            if (this.mConceptCardData == null)
            {
                return;
            }
            this.m_UnitData = unitData;
            this.mIsEnhance = bEnhance;
            int mixTotalExp;
            int mixTrustExp;
            int mixTotalAwakeLv;

            ConceptCardManager.CalcTotalExpTrust(out mixTotalExp, out mixTrustExp, out mixTotalAwakeLv);
            this.mEnhanceInfo = new ConceptCardDescription.ConceptCardEnhanceInfo(data, mixTotalExp, mixTrustExp, mixTotalAwakeLv);
            this.CreatePrefab(ability_detail_parent);
            this.SetParam((ConceptCardDetailBase)this.Level, this.mConceptCardData, mixTotalExp, mixTrustExp, mixTotalAwakeLv);
            this.SetParam((ConceptCardDetailBase)this.Status, this.mConceptCardData, mixTotalExp, mixTrustExp, mixTotalAwakeLv);
            if (this.Skin != null)
            {
                for (int index = 0; index < this.Skin.Count; ++index)
                {
                    this.SetParam((ConceptCardDetailBase)this.Skin[index], this.mConceptCardData);
                }
            }
            if (Object.op_Inequality((Object)this.GetUnit, (Object)null))
            {
                if (!is_first_get_unit)
                {
                    ((Component)this.GetUnit).get_gameObject().SetActive(false);
                }
                this.SetParam((ConceptCardDetailBase)this.GetUnit, this.mConceptCardData);
            }
            if (Object.op_Inequality((Object)this.OpenBonusButton, (Object)null))
            {
                bool flag = this.mConceptCardData.IsEnableAwake;
                if (!this.mConceptCardData.Param.IsExistAddCardSkillBuffAwake() && !this.mConceptCardData.Param.IsExistAddCardSkillBuffLvMax())
                {
                    flag = false;
                }
                ((Selectable)this.OpenBonusButton).set_interactable(flag);
            }
            this.Refresh();
        }