public void RefreshDesc() { int skinId = 0; switch (SelectSkinType) { case CommonData.SKIN_TYPE.CHAR: skinId = SkinCharBookSlotList[SelectIndex].SkinId; break; case CommonData.SKIN_TYPE.DOOR: skinId = SkinDoorBookSlotList[SelectIndex].SkinId; break; case CommonData.SKIN_TYPE.BACKGROUND: skinId = SkinBgBookSlotList[SelectIndex].SkinId; break; default: break; } SkinData data = DataManager.Instance.GetSkinData(SelectSkinType, skinId); var skinSkillName = data.GetSkillName(); var skinSkillData = SkillManager.Instance.GetSkillData(skinSkillName); StringBuilder desc = new StringBuilder(); desc.AppendFormat("{0}{1}", LocalizeData.Instance.GetLocalizeString("POPUP_GAME_SHOP_DESC_NAME"), data.GetLocalizeName()); desc.AppendLine(); desc.AppendLine(); desc.AppendFormat(data.GetLocalizeDesc()); desc.AppendLine(); desc.AppendLine(); if (skinSkillData.GetDesc() != "") { desc.AppendFormat(skinSkillData.GetDesc()); } SkinDesc.text = desc.ToString(); if (SelectSkinType != CommonData.SKIN_TYPE.CHAR) { SkinIcon.gameObject.SetActive(true); SkinCharIcon.gameObject.SetActive(false); CommonFunc.SetImageFile(data.GetIcon(), ref SkinIcon, false); } else { var charData = data as CharData; SkinIcon.gameObject.SetActive(false); SkinCharIcon.gameObject.SetActive(true); SkinCharIconAnim.Rebind(); SkinCharIconAnim.SetTrigger(charData.shopani_trigger); } }
public void RefreshUI() { var level = PlayerData.Instance.GetSkinSlotLevel(SkinType); if (level == 1) { LevelBg.gameObject.SetActive(false); Level.gameObject.SetActive(false); } else { LevelBg.gameObject.SetActive(true); Level.gameObject.SetActive(true); Level.SetValue(string.Format("+{0}", level - 1), UICountImgFont.IMG_RANGE.CENTER, UICountImgFont.IMG_TYPE.WHITE); } SkinData skinData = PlayerData.Instance.GetUseSkinData(SkinType); CommonFunc.SetImageFile(skinData.GetIcon(), ref SkinIcon, false); }
public void RefreshDesc() { SkinBuyButton.gameObject.SetActive(false); UpgradeSlotButton.gameObject.SetActive(false); SkinEquipButton.gameObject.SetActive(false); DescIcon.gameObject.SetActive(false); DescCharIcon.gameObject.SetActive(false); DescSkinSlot.gameObject.SetActive(false); SkinData data = null; if (SelectLIst) { var skinId = ShopSkinList[SelectSlotIndex].SkinId; data = DataManager.Instance.GetSkinData(SelectSkinType, skinId); if (PlayerData.Instance.GetUseSkin(SelectSkinType) != skinId) { if (PlayerData.Instance.HasSkin(SelectSkinType, skinId)) { SkinEquipButton.gameObject.SetActive(true); } else { SkinBuyButton.gameObject.SetActive(true); SkinBuyCost.SetValue(data.cost); } } DescTitle.text = data.GetLocalizeName(); var skinSkillName = data.GetSkillName(); var skinSkillData = SkillManager.Instance.GetSkillData(skinSkillName); StringBuilder desc = new StringBuilder(); if (SelectSkinType == CommonData.SKIN_TYPE.DOOR) { var doorData = data as DoorData; if (PlayerData.Instance.HasSkinName(CommonData.SKIN_TYPE.BACKGROUND, doorData.buy_bg) == false) { var str = LocalizeData.Instance.GetLocalizeString("POPUP_SHOP_BUY_DOOR_BACKGROUND", LocalizeData.Instance.GetLocalizeString(string.Format("{0}_SHOT", doorData.buy_bg))); desc.AppendFormat(str); } else { desc.AppendFormat(data.GetLocalizeDesc()); } } else if (SelectSkinType == CommonData.SKIN_TYPE.BACKGROUND) { var bgData = data as BackgroundData; if (PlayerData.Instance.HasSkinName(CommonData.SKIN_TYPE.BACKGROUND, bgData.buy_bg) == false) { var str = LocalizeData.Instance.GetLocalizeString("POPUP_SHOP_BUY_DOOR_BACKGROUND", LocalizeData.Instance.GetLocalizeString(string.Format("{0}_SHOT", bgData.buy_bg))); desc.AppendFormat(str); } else { desc.AppendFormat(data.GetLocalizeDesc()); } } else { desc.AppendFormat(data.GetLocalizeDesc()); } desc.AppendLine(); desc.AppendLine(); desc.AppendFormat(LocalizeData.Instance.GetLocalizeString("POPUP_GAME_READY_DESC_SKIN_SKILL", skinSkillData.GetDesc())); Desc.text = desc.ToString(); if (SelectSkinType != CommonData.SKIN_TYPE.CHAR) { DescIcon.gameObject.SetActive(true); DescCharIcon.gameObject.SetActive(false); CommonFunc.SetImageFile(data.GetIcon(), ref DescIcon, false); } else { var charData = data as CharData; DescIcon.gameObject.SetActive(false); DescCharIcon.gameObject.SetActive(true); DescCharIconAnim.Rebind(); DescCharIconAnim.SetTrigger(charData.shopani_trigger); } } else { DescSkinSlot.gameObject.SetActive(true); data = PlayerData.Instance.GetUseSkinData(SelectSkinType); var level = PlayerData.Instance.GetSkinSlotLevel(SelectSkinType); if (level < DataManager.Instance.SkinSlotLevelDataList[SelectSkinType].Count) { var levelData = DataManager.Instance.SkinSlotLevelDataList[SelectSkinType][level]; UpgradeSlotButton.gameObject.SetActive(true); UpgradeSlotCost.SetValue(levelData.cost); } DescSkinSlot.SetSkinSlot(SelectSkinType); DescTitle.text = data.GetSkinSlotTypeName(); var slotSkillName = PlayerData.Instance.GetSkinSlotSkill(SelectSkinType); var slotSkillData = SkillManager.Instance.GetSkillData(slotSkillName); var skinSkillData = SkillManager.Instance.GetSkillData(data.GetSkillName()); StringBuilder desc = new StringBuilder(); if (SelectSkinType == CommonData.SKIN_TYPE.BACKGROUND) { var bgData = data as BackgroundData; desc.AppendFormat(LocalizeData.Instance.GetLocalizeString("POPUP_GAME_READY_DESC_SLOT_CURR_SKIN", bgData.GetLocalizeNameReady())); } else { desc.AppendFormat(LocalizeData.Instance.GetLocalizeString("POPUP_GAME_READY_DESC_SLOT_CURR_SKIN", data.GetLocalizeName())); } desc.AppendLine(); desc.AppendLine(); desc.AppendFormat(LocalizeData.Instance.GetLocalizeString("POPUP_GAME_READY_DESC_SLOT_SKILL", slotSkillData.GetDesc())); desc.AppendLine(); desc.AppendFormat(LocalizeData.Instance.GetLocalizeString("POPUP_GAME_READY_DESC_SKIN_SKILL", skinSkillData.GetDesc())); Desc.text = desc.ToString(); } }