/// <summary> /// 设置成就达成条件 /// </summary> /// <param name="data"></param> public void SetAchieve(AchievementStatusEnum status, AchievementInfoBean data) { CptUtil.RemoveChildsByActive(objAchieveContent.transform); if (data == null) { return; } List <PreTypeBean> listPreData = PreTypeEnumTools.GetListPreData(data.pre_data); GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData(); foreach (var itemPreData in listPreData) { if (status == AchievementStatusEnum.Completed) { PreTypeEnumTools.GetPreDetails(itemPreData, gameData, true); } else { PreTypeEnumTools.GetPreDetails(itemPreData, gameData, false); } string preDes = itemPreData.preDescribe; float progress = itemPreData.progress; CreateAchieveItem(preDes, progress); } }
/// <summary> /// 创建成就列表 /// </summary> /// <param name="listData"></param> public IEnumerator CreateAchList(List <AchievementInfoBean> listData) { GameDataBean gameData = GameDataHandler.Instance.manager.GetGameData(); UserAchievementBean userAchievement = gameData.GetAchievementData(); List <long> achievementList = userAchievement.listAchievement; //if (achievementList == null || achievementList.Count == 0) //{ // tvNull.gameObject.SetActive(true); // return; //} tvNull.gameObject.SetActive(false); for (int i = 0; i < listData.Count; i++) { AchievementInfoBean achievementInfo = listData[i]; GameObject objItem = Instantiate(objAchContainer, objAchItem); ItemGameStatisticsForAchCpt achCpt = objItem.GetComponent <ItemGameStatisticsForAchCpt>(); if (achievementList.Contains(achievementInfo.id)) { achCpt.SetData(achievementInfo, true); } else { achCpt.SetData(achievementInfo, false); } if (i % ProjectConfigInfo.ITEM_REFRESH_NUMBER == 0) { yield return(new WaitForEndOfFrame()); } } }
/// <summary> /// 插入数据 /// </summary> /// <param name="achievementInfo"></param> public void InsertData(AchievementInfoBean achievementInfo) { List <string> listLeftName = new List <string>() { "ach_id", "name", "content" }; BaseInsertDataWithLeft(achievementInfo, listLeftName); }
/// <summary> /// 成就展示 /// </summary> /// <param name="achievementInfo"></param> public void SetData(AchievementInfoBean achievementInfo) { this.achievementInfo = achievementInfo; SetIcon(achievementInfo.type, achievementInfo.icon_key, achievementInfo.icon_key_remark); SetName(achievementInfo.name); SetTitle(TextHandler.Instance.manager.GetTextById(76)); SetReward(achievementInfo.reward_data); SetDataForCommon(); }
public void SetData(AchievementStatusEnum status, AchievementInfoBean achievementInfo) { this.status = status; this.achievementInfo = achievementInfo; SetIcon(achievementInfo.GetAchievementType(), achievementInfo.icon_key, achievementInfo.icon_key_remark); SetName(achievementInfo.name); SetContent(achievementInfo.content); SetAchieve(status, achievementInfo); SetStatus(status); SetReward(achievementInfo); }
/// <summary> /// 创建成就列表 /// </summary> /// <param name="listData"></param> public void CreateAchievementData(List <AchievementInfoBean> listData) { CptUtil.RemoveChildsByActive(objGroceryContent.transform); if (listData == null || objGroceryContent == null || objGroceryModel == null) { return; } for (int i = 0; i < listData.Count; i++) { AchievementInfoBean itemData = listData[i]; GameObject itemObj = Instantiate(objGroceryContent, objGroceryModel); ItemTownGuildAchievementCpt achCpt = itemObj.GetComponent <ItemTownGuildAchievementCpt>(); achCpt.SetData(itemData); //itemObj.transform.DOScale(new Vector3(0, 0, 0), 0.5f).SetEase(Ease.OutBack).SetDelay(i * 0.02f).From(); } }
/// <summary> /// 设置数据 /// </summary> /// <param name="achievementInfo"></param> /// <param name="spIcon"></param> /// <param name="isUnLock"></param> public void SetData(AchievementInfoBean achievementInfo, bool isUnLock) { if (isUnLock) { Sprite spIcon = IconDataHandler.Instance.manager.GetIconSpriteByName(achievementInfo.icon_key); SetIcon(spIcon); popupButton.SetData(AchievementStatusEnum.Completed, achievementInfo); ivBackground.sprite = spUnLockBackground; } else { SetIcon(null); ivBackground.sprite = spLockBackground; popupButton.SetData(AchievementStatusEnum.UnKnown, achievementInfo); } }
/// <summary> /// 设置奖励 /// </summary> /// <param name="data"></param> public void SetReward(AchievementInfoBean data) { CptUtil.RemoveChildsByActive(objRewardContent.transform); if (data == null) { return; } List <RewardTypeBean> listRewardData = RewardTypeEnumTools.GetListRewardData(data.reward_data); GameObject objTitle = Instantiate(objRewardContent, objRewardTitle); foreach (var itemRewardData in listRewardData) { RewardTypeEnumTools.GetRewardDetails(itemRewardData); string rewardDes = itemRewardData.rewardDescribe; Sprite spReward = itemRewardData.spRewardIcon; CreateRewardItem(rewardDes, spReward); } //} ////奖励-道具 //if (!CheckUtil.StringIsNull(data.reward_items_ids)) //{ // List<long> listItems = data.GetRewardItems(); // foreach (long itemId in listItems) // { // ItemsInfoBean itemsInfo = GameItemsHandler.Instance.manager.GetItemsById(itemId); // if (itemsInfo == null) // continue; // Sprite spIcon; // if (itemsInfo.items_type == (int)GeneralEnum.Hat) // { // spIcon = GameItemsHandler.Instance.manager.GetItemsSpriteByName("unknown_hat_1"); // } // else if (itemsInfo.items_type == (int)GeneralEnum.Clothes) // { // spIcon = GameItemsHandler.Instance.manager.GetItemsSpriteByName("unknown_clothes_1"); // } // else if (itemsInfo.items_type == (int)GeneralEnum.Shoes) // { // spIcon = GameItemsHandler.Instance.manager.GetItemsSpriteByName("unknown_shoes_1"); // } // else // { // spIcon = GameItemsHandler.Instance.manager.GetItemsSpriteByName(itemsInfo.icon_key); // } // CreateRewardItem(itemsInfo.name, 0, spIcon); // } //} ////奖励-建筑材料 //if (!CheckUtil.StringIsNull(data.reward_build_ids)) //{ // List<long> listBuild = data.GetRewardBuild(); // foreach (long buildId in listBuild) // { // BuildItemBean buildItem = InnBuildHandler.Instance.manager.GetBuildDataById(buildId); // if (buildItem == null) // continue; // Sprite spIcon = innBuildManager.GetFurnitureSpriteByName(buildItem.icon_key); // CreateRewardItem(buildItem.name, 0, spIcon); // } //} }
public void SetData(AchievementInfoBean data) { this.achievementInfo = data; SetIcon(data.id, data.GetPreAchIds(), data.icon_key, data.pre_data); }
public void SetData(AchievementStatusEnum status, AchievementInfoBean achievementInfo) { this.achievementInfo = achievementInfo; this.status = status; }
/// <summary> /// 更新数据 /// </summary> /// <param name="achievementInfo"></param> public void Update(AchievementInfoBean achievementInfo) { DeleteDataById(achievementInfo.id); InsertData(achievementInfo); }