private string GetPresentName(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM masterAssetCategory, string objectId) { string result = StringMaster.GetString("Present-10"); if (masterAssetCategory != null) { result = masterAssetCategory.assetTitle; } MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory)masterAssetCategory.assetCategoryId.ToInt32(); switch (assetCategory) { case MasterDataMng.AssetCategory.FACILITY_KEY: { FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(objectId); if (facilityKeyMaster != null) { result = facilityKeyMaster.facilityKeyName; } break; } default: if (assetCategory != MasterDataMng.AssetCategory.MONSTER) { if (assetCategory == MasterDataMng.AssetCategory.ITEM) { GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(objectId); if (itemM != null) { result = itemM.name; } } } else { GameWebAPI.RespDataMA_GetMonsterMS.MonsterM simple = MonsterMaster.GetMonsterMasterByMonsterId(objectId).Simple; if (simple != null) { GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(simple.monsterGroupId).Group; if (group != null) { result = group.monsterName; } } } break; case MasterDataMng.AssetCategory.DUNGEON_TICKET: { GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => objectId == x.dungeonTicketId); if (dungeonTicketM != null) { result = dungeonTicketM.name; } break; } } return(result); }
public void SetParam(FacilityConditionM data, string assetValue, FacilityM faciltyData) { FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(assetValue); if (facilityKeyMaster != null) { this.titleLabel.text = facilityKeyMaster.facilityKeyName; } this.textLabel.text = faciltyData.description; FacilityM facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(data.releaseId); string iconPath = facilityMasterByReleaseId.GetIconPath(); this.iconSprite.gameObject.SetActive(false); this.iconTexture.gameObject.SetActive(true); NGUIUtil.ChangeUITextureFromFile(this.iconTexture, iconPath, false); }
public void SetDetail(GameWebAPI.RespDataMS_EventExchangeInfoLogic.Result.Detail exchangeInfo, int selectItemNum, Action <ExchangeItem> touchEvent) { this.onPushedButton = touchEvent; GUICollider component = this.pushedButton.GetComponent <GUICollider>(); component.onTouchEnded += delegate(Touch touch, Vector2 pos, bool flag) { this.onPushedButton(this); }; this.selectNum = selectItemNum; int.TryParse(exchangeInfo.eventExchangeDetailId, out this.exchangeDetailId); this.exchangeItemData = exchangeInfo.item; string text = string.Empty; string value = string.Empty; this.exchangeInfoData = exchangeInfo; this.viewIcon.gameObject.SetActive(true); this.viewIconTexture.gameObject.SetActive(false); GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM assetCategory = MasterDataMng.Instance().RespDataMA_AssetCategoryM.GetAssetCategory(exchangeInfo.assetCategoryId); string text2 = string.Empty; if (assetCategory != null) { text2 = assetCategory.assetTitle; } this.exchangeDetailCategoryID = exchangeInfo.assetCategoryId; MasterDataMng.AssetCategory assetCategory2 = (MasterDataMng.AssetCategory) int.Parse(exchangeInfo.assetCategoryId); this.numCountLabel.text = "1"; switch (assetCategory2) { case MasterDataMng.AssetCategory.MONSTER: { text = string.Empty; if (this.micon != null) { UnityEngine.Object.Destroy(this.micon.gameObject); } this.viewIcon.gameObject.SetActive(false); MonsterData monsterData = MonsterDataMng.Instance().CreateMonsterDataByMID(exchangeInfo.assetValue); this.exchangeDetailName = monsterData.monsterMG.monsterName; this.micon = GUIMonsterIcon.MakePrefabByMonsterData(monsterData, new Vector3(1f, 1f, 1f), new Vector3(-165f, 25f, 0f), this.iconRoot.transform, true, false); UIWidget component2 = base.gameObject.GetComponent <UIWidget>(); if (component2 != null) { DepthController component3 = this.micon.GetComponent <DepthController>(); if (component3 != null) { component3.AddWidgetDepth(this.micon.transform, component2.depth + 10); } } this.micon.GetDepthController(); BoxCollider component4 = this.micon.gameObject.GetComponent <BoxCollider>(); if (component4 != null) { component4.enabled = false; } break; } case MasterDataMng.AssetCategory.DIGI_STONE: text = "Common02_LB_Stone"; this.exchangeDetailName = text2; break; case MasterDataMng.AssetCategory.LINK_POINT: text = "Common02_LB_Link"; this.exchangeDetailName = text2; break; case MasterDataMng.AssetCategory.TIP: text = "Common02_LB_Chip"; this.exchangeDetailName = text2; break; default: switch (assetCategory2) { case MasterDataMng.AssetCategory.MEAT: text = "Common02_item_meat"; this.exchangeDetailName = text2; goto IL_567; case MasterDataMng.AssetCategory.SOUL: { this.exchangeDetailName = text2; GameWebAPI.RespDataMA_GetSoulM.SoulM soul = MasterDataMng.Instance().RespDataMA_SoulM.GetSoul(exchangeInfo.assetValue); value = soul.soulName; this.viewIconTexture.gameObject.SetActive(true); string evolveItemIconPathByID = ClassSingleton <EvolutionData> .Instance.GetEvolveItemIconPathByID(exchangeInfo.assetValue); NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, evolveItemIconPathByID, false); this.viewIcon.gameObject.SetActive(false); goto IL_567; } case MasterDataMng.AssetCategory.FACILITY_KEY: { this.viewIconTexture.gameObject.SetActive(true); this.viewIcon.gameObject.SetActive(false); FacilityConditionM[] facilityCondition = FarmDataManager.GetFacilityCondition(exchangeInfo.assetValue); FacilityConditionM facilityConditionM = facilityCondition.FirstOrDefault((FacilityConditionM x) => int.Parse(x.conditionType) == 1); FacilityM facilityMasterByReleaseId = FarmDataManager.GetFacilityMasterByReleaseId(facilityConditionM.releaseId); NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, facilityMasterByReleaseId.GetIconPath(), false); FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(exchangeInfo.assetValue); if (facilityKeyMaster != null) { this.exchangeDetailName = facilityKeyMaster.facilityKeyName; } goto IL_567; } case MasterDataMng.AssetCategory.CHIP: { GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(exchangeInfo.assetValue); ChipDataMng.MakePrefabByChipData(chipMainData, this.viewIcon.gameObject, this.viewIcon.gameObject.transform.localPosition, this.viewIcon.gameObject.transform.localScale, null, 128, 128, false); this.exchangeDetailName = chipMainData.name; this.viewIcon.gameObject.SetActive(false); goto IL_567; } case MasterDataMng.AssetCategory.DUNGEON_TICKET: { this.viewIconTexture.gameObject.SetActive(true); this.viewIcon.gameObject.SetActive(false); GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => exchangeInfo.assetValue == x.dungeonTicketId); if (dungeonTicketM != null) { global::Debug.Log(dungeonTicketM.img); NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, dungeonTicketM.img, false); this.exchangeDetailName = dungeonTicketM.name; } goto IL_567; } } text = string.Empty; this.exchangeDetailName = StringMaster.GetString("Present-10"); break; case MasterDataMng.AssetCategory.ITEM: { GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(exchangeInfo.assetValue); if (itemM != null) { this.exchangeDetailName = itemM.name; this.viewIconTexture.gameObject.SetActive(true); this.viewIcon.gameObject.SetActive(false); string largeImagePath = itemM.GetLargeImagePath(); NGUIUtil.ChangeUITextureFromFile(this.viewIconTexture, largeImagePath, false); } break; } } IL_567: if (!string.IsNullOrEmpty(text) && assetCategory2 != MasterDataMng.AssetCategory.MONSTER) { this.viewIcon.spriteName = text; } if (assetCategory2 == MasterDataMng.AssetCategory.TIP) { this.exchangeDetailNum = StringFormat.Cluster(exchangeInfo.assetNum); } else { this.exchangeDetailNum = exchangeInfo.assetNum; } if (assetCategory2 != MasterDataMng.AssetCategory.MONSTER) { this.titleLabel.text = string.Format(StringMaster.GetString("SystemItemCount"), this.exchangeDetailName, this.exchangeDetailNum); } else { this.titleLabel.text = this.exchangeDetailName; } if (!string.IsNullOrEmpty(value)) { this.exchangeDetailName = value; } this.exchangeConsumeNum = exchangeInfo.needNum; this.buildNumLabel.text = this.exchangeConsumeNum; this.ExchangeIconSet(exchangeInfo); this.ResetNum(exchangeInfo); this.SetButton(exchangeInfo); this.ShowGUI(); }
private static string GetAssetValueName(int assetCategoryId, string assetValue) { string result = string.Empty; switch (assetCategoryId) { case 14: { GameWebAPI.RespDataMA_GetSoulM.SoulM soulMasterBySoulId = VersionUpMaterialData.GetSoulMasterBySoulId(assetValue); if (soulMasterBySoulId != null) { result = soulMasterBySoulId.soulName; } break; } default: if (assetCategoryId != 1) { if (assetCategoryId == 6) { GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(assetValue); if (itemM != null) { result = itemM.name; } } } else { GameWebAPI.RespDataMA_GetMonsterMS.MonsterM simple = MonsterMaster.GetMonsterMasterByMonsterId(assetValue).Simple; if (simple != null) { GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(simple.monsterGroupId).Group; if (group != null) { result = group.monsterName; } } } break; case 16: { FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(assetValue); if (facilityKeyMaster != null) { result = facilityKeyMaster.facilityKeyName; } break; } case 17: { int chipId = int.Parse(assetValue); GameWebAPI.RespDataMA_ChipM.Chip chipMaster = ChipDataMng.GetChipMaster(chipId); if (chipMaster != null) { result = chipMaster.name; } break; } case 18: { GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => assetValue == x.dungeonTicketId); if (dungeonTicketM != null) { result = dungeonTicketM.name; } break; } case 19: { GameWebAPI.RespDataMA_TitleMaster.TitleM titleM = TitleDataMng.GetDictionaryTitleM()[int.Parse(assetValue)]; if (titleM != null) { result = titleM.name; } break; } } return(result); }
public string GetPresentName(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM masterAssetCategory, string objectId, bool showDetail = false) { string result = StringMaster.GetString("Present-10"); if (masterAssetCategory != null) { result = masterAssetCategory.assetTitle; } MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory)masterAssetCategory.assetCategoryId.ToInt32(); switch (assetCategory) { case MasterDataMng.AssetCategory.FACILITY_KEY: { FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(objectId); if (facilityKeyMaster != null) { result = facilityKeyMaster.facilityKeyName; } break; } default: if (assetCategory != MasterDataMng.AssetCategory.MONSTER) { if (assetCategory == MasterDataMng.AssetCategory.ITEM) { GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(objectId); if (itemM != null) { result = itemM.name; } } } else { GameWebAPI.RespDataMA_GetMonsterMS.MonsterM simple = MonsterMaster.GetMonsterMasterByMonsterId(objectId).Simple; if (simple != null) { GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(simple.monsterGroupId).Group; if (group != null) { result = group.monsterName; } } } break; case MasterDataMng.AssetCategory.DUNGEON_TICKET: { GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => objectId == x.dungeonTicketId); if (dungeonTicketM != null) { result = dungeonTicketM.name; } break; } case MasterDataMng.AssetCategory.TITLE: { GameWebAPI.RespDataMA_TitleMaster.TitleM titleM = TitleDataMng.GetDictionaryTitleM()[int.Parse(objectId)]; if (titleM != null) { result = titleM.name; } break; } } if (showDetail) { MasterDataMng.AssetCategory assetCategory2 = (MasterDataMng.AssetCategory)masterAssetCategory.assetCategoryId.ToInt32(); if (assetCategory2 != MasterDataMng.AssetCategory.CHIP) { if (assetCategory2 == MasterDataMng.AssetCategory.SOUL) { GameWebAPI.RespDataMA_GetSoulM.SoulM soulMasterBySoulId = VersionUpMaterialData.GetSoulMasterBySoulId(objectId); result = soulMasterBySoulId.soulName; } } else { int chipId = int.Parse(objectId); GameWebAPI.RespDataMA_ChipM.Chip chipMaster = ChipDataMng.GetChipMaster(chipId); result = chipMaster.name; } } return(result); }