public bool Deserialize(JSON_ConceptCard json) { this.mUniqueID = (OLong)json.iid; this.mExp = (OInt)json.exp; this.mTrust = (OInt)json.trust; this.mFavorite = json.fav != 0; this.mTrustBonus = json.trust_bonus != 0; this.mAwakeCount = (OInt)json.plus; this.mConceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(json.iname); this.mLv = (OInt)this.CalcCardLevel(); this.UpdateEquipEffect(); this.RefreshFilterType(); return(true); }
private void Init() { if (Object.op_Equality((Object)this.UseExpItemSlider, (Object)null) || Object.op_Equality((Object)this.SelectUseNum, (Object)null) || (Object.op_Equality((Object)this.CardIcon, (Object)null) || this.mConceptCardMaterialData == null)) { return; } ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam((string)this.mConceptCardMaterialData.IName); if (conceptCardParam == null) { return; } JSON_ConceptCard json = new JSON_ConceptCard(); json.iid = (long)this.mConceptCardMaterialData.UniqueID; json.iname = (string)this.mConceptCardMaterialData.IName; json.exp = conceptCardParam.en_exp; json.trust = conceptCardParam.en_trust; this.mCardData = new ConceptCardData(); this.mCardData.Deserialize(json); this.CardIcon.Setup(this.mCardData); this.mCurrentItemID = (string)this.mConceptCardMaterialData.IName; ConceptCardManager instance = ConceptCardManager.Instance; if (Object.op_Equality((Object)instance, (Object)null)) { return; } int num; if (this.mConceptCardMaterialData.Param.type == eCardType.Enhance_exp) { num = Mathf.Min(instance.SelectedConceptCardData.GetExpToLevelMax() / this.mConceptCardMaterialData.Param.en_exp, (int)this.mConceptCardMaterialData.Num); if (this.mConceptCardMaterialData.Param.en_exp * num < instance.SelectedConceptCardData.GetExpToLevelMax() && num < (int)this.mConceptCardMaterialData.Num) { ++num; } } else { if (this.mConceptCardMaterialData.Param.type != eCardType.Enhance_trust) { return; } num = Mathf.Min(instance.SelectedConceptCardData.GetTrustToLevelMax() / this.mConceptCardMaterialData.Param.en_trust, (int)this.mConceptCardMaterialData.Num); if (this.mConceptCardMaterialData.Param.en_trust * num < instance.SelectedConceptCardData.GetTrustToLevelMax() && num < (int)this.mConceptCardMaterialData.Num) { ++num; } } ((UnityEventBase)this.UseExpItemSlider.get_onValueChanged()).RemoveAllListeners(); this.UseExpItemSlider.set_minValue(0.0f); this.UseExpItemSlider.set_maxValue((float)num); // ISSUE: method pointer ((UnityEvent <float>) this.UseExpItemSlider.get_onValueChanged()).AddListener(new UnityAction <float>((object)this, __methodptr(OnSelectUseNumChanged))); this.UseExpItemSlider.set_value(this.UseExpItemSlider.get_minValue()); this.SelectUseNum.set_text(this.UseExpItemSlider.get_value().ToString()); if (Object.op_Inequality((Object)this.UseItemNum, (Object)null)) { this.UseItemNum.set_text(this.UseExpItemSlider.get_value().ToString()); } if (Object.op_Inequality((Object)this.ConceptCardEnExp, (Object)null)) { this.ConceptCardEnExp.set_text(this.mCardData.Param.en_exp.ToString()); } this.mMaxValue = num; if (Object.op_Inequality((Object)this.CardNum, (Object)null)) { this.CardNum.set_text(Mathf.Min((int)this.mConceptCardMaterialData.Num, this.MaxCardNum).ToString()); } if (Object.op_Inequality((Object)this.CheckUseMax, (Object)null)) { // ISSUE: method pointer ((UnityEvent <bool>) this.CheckUseMax.onValueChanged).AddListener(new UnityAction <bool>((object)this, __methodptr(OnChangeUseMax))); } if (Object.op_Inequality((Object)this.PlusBtn, (Object)null)) { ((Selectable)this.PlusBtn).set_interactable(Object.op_Inequality((Object)this.UseExpItemSlider, (Object)null) && (double)this.UseExpItemSlider.get_value() < (double)this.UseExpItemSlider.get_maxValue()); } if (!Object.op_Inequality((Object)this.MinusBtn, (Object)null)) { return; } ((Selectable)this.MinusBtn).set_interactable(Object.op_Inequality((Object)this.UseExpItemSlider, (Object)null) && (double)this.UseExpItemSlider.get_value() > (double)this.UseExpItemSlider.get_minValue()); }