备份CatanBuilding瘦身独立工程
This commit is contained in:
109
Assets/Scripts/UI/FishingTarget/EventTargetGrandPrizeTips.cs
Normal file
109
Assets/Scripts/UI/FishingTarget/EventTargetGrandPrizeTips.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class EventTargetGrandPrizeTips : MonoBehaviour
|
||||
{
|
||||
Button btnClose;
|
||||
//Image bar;
|
||||
private void Awake()
|
||||
{
|
||||
btnClose = transform.Find("btn_close").GetComponent<Button>();
|
||||
//bar = transform.Find("tips/bg/bg_bar/bar").GetComponent<Image>();
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
btnClose.onClick.AddListener(() => gameObject.SetActive(false));
|
||||
Init();
|
||||
}
|
||||
void Init()
|
||||
{
|
||||
PlayerItemData playerItemData = GContext.container.Resolve<PlayerItemData>();
|
||||
var _fishingEventData = GContext.container.Resolve<FishingEventData>();
|
||||
IUIService uIService = GContext.container.Resolve<IUIService>();
|
||||
var tables = GContext.container.Resolve<Tables>();
|
||||
CollectingTargetInit collectingTargetInit = _fishingEventData.collectingTargetInit;
|
||||
Item item = tables.TbItem[collectingTargetInit.TokenID];
|
||||
var TargetList = collectingTargetInit.TargetList;
|
||||
//设置tips
|
||||
int targetCount = 0;
|
||||
List<int> targetCounts = new List<int>();
|
||||
List<CollectingTargetReward> CollectingTargetRewards = new List<CollectingTargetReward>();
|
||||
int index = 0;
|
||||
int allCount = _fishingEventData.GetAllCollectingTarget();
|
||||
for (int i = 0; i < TargetList.Count; i++)
|
||||
{
|
||||
CollectingTargetReward targetReward = tables.TbCollectingTargetReward.GetOrDefault(TargetList[i]);
|
||||
targetCount += targetReward.TokenRequired;
|
||||
if (targetReward.Milestone != 0)
|
||||
{
|
||||
targetCounts.Add(targetCount);
|
||||
CollectingTargetRewards.Add(targetReward);
|
||||
if (targetCount < allCount)
|
||||
{
|
||||
index = CollectingTargetRewards.Count;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollectingTargetRewards.Count < 4)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CollectingTargetReward curReward = null;
|
||||
if (index < CollectingTargetRewards.Count)
|
||||
{
|
||||
curReward = CollectingTargetRewards[index];
|
||||
}
|
||||
|
||||
if (index > CollectingTargetRewards.Count - 4)
|
||||
{
|
||||
index = CollectingTargetRewards.Count - 4;
|
||||
}
|
||||
int rewardIndex = 0;
|
||||
//bar.fillAmount = 1;
|
||||
for (int i = index; i < index + 4; i++)
|
||||
{
|
||||
rewardIndex++;
|
||||
Transform reward = transform.Find($"tips/bg/item{rewardIndex}");
|
||||
GameObject unlock = reward.Find("bg_normal").gameObject;
|
||||
GameObject done = reward.Find("bg_done").gameObject;
|
||||
CollectingTargetReward targetReward = CollectingTargetRewards[i];
|
||||
if (curReward == null || targetReward.TaskID < curReward.TaskID)
|
||||
{
|
||||
//已领取
|
||||
unlock.SetActive(false);
|
||||
done.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (targetReward.TaskID == curReward.TaskID)
|
||||
//{
|
||||
// float difference = targetCounts[i] - allCount;
|
||||
// int difference2 = targetCounts[i];
|
||||
// if (i > 0)
|
||||
// {
|
||||
// difference2 = targetCounts[i] - targetCounts[i - 1];
|
||||
// }
|
||||
|
||||
// //bar.fillAmount = 0.25f * (rewardIndex - difference / difference2);
|
||||
//}
|
||||
//未领取
|
||||
unlock.SetActive(true);
|
||||
done.SetActive(false);
|
||||
}
|
||||
Rewardx1x2 rewardItemNew = reward.GetComponent<Rewardx1x2>();
|
||||
var itemData1 = playerItemData.GetItemDataByDropId(targetReward.DropID);
|
||||
rewardItemNew.SetData(itemData1);
|
||||
TMP_Text text_num = reward.Find("text_num").GetComponent<TMP_Text>();
|
||||
text_num.text = targetCounts[i].ToString();
|
||||
Image icon = reward.Find("icon_target").GetComponent<Image>();
|
||||
uIService.SetImageSprite(icon, item.Icon);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f42b44d24003b954a99bc386dec16781
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
22
Assets/Scripts/UI/FishingTarget/FishingTargetItem.cs
Normal file
22
Assets/Scripts/UI/FishingTarget/FishingTargetItem.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FishingTargetItem : MonoBehaviour
|
||||
{
|
||||
public Image icon_target;
|
||||
public TMP_Text text_num;
|
||||
public TMP_Text text_name;
|
||||
public GameObject photo_nofound;
|
||||
public TMP_Text text_catch;
|
||||
public GameObject text_nofound;
|
||||
public void Init()
|
||||
{
|
||||
photo_nofound = transform.Find("photo_nofound").gameObject;
|
||||
icon_target = transform.Find("text_num/icon_target").GetComponent<Image>();
|
||||
text_num = transform.Find("text_num").GetComponent<TMP_Text>();
|
||||
text_name = transform.Find("info/text_name").GetComponent<TMP_Text>();
|
||||
text_catch = transform.Find("info/text_catch").GetComponent<TMP_Text>();
|
||||
text_nofound = transform.Find("info/text_nofound").gameObject;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/FishingTarget/FishingTargetItem.cs.meta
Normal file
11
Assets/Scripts/UI/FishingTarget/FishingTargetItem.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fd95ec4b5f17a3409a537bc58d09d2f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
54
Assets/Scripts/UI/FishingTarget/FishingTargetPopupPanel.cs
Normal file
54
Assets/Scripts/UI/FishingTarget/FishingTargetPopupPanel.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
|
||||
public class FishingTargetPopupPanel : FishingTargetPopupPanelBase
|
||||
{
|
||||
public TargetInfoBase curTargetInfoBase;
|
||||
public TargetInfoBase targetInfoBase1;
|
||||
public TargetInfoBase targetInfoBase2;
|
||||
public TargetInfoBase targetInfoBase3;
|
||||
protected override void Awake()
|
||||
{
|
||||
targetInfoBase1 = transform.Find("root/target_info1").GetComponent<TargetInfoBase>();
|
||||
targetInfoBase2 = transform.Find("root/target_info2").GetComponent<TargetInfoBase>();
|
||||
targetInfoBase3 = transform.Find("root/target_info3").GetComponent<TargetInfoBase>();
|
||||
base.Awake();
|
||||
}
|
||||
|
||||
protected override void SetTargetExtra(string icon)
|
||||
{
|
||||
EventTargetExtraDrop eventTargetExtraDrop = _fishingEventData.GetEventTargetExtraDrop();
|
||||
targetInfoBase1.gameObject.SetActive(false);
|
||||
targetInfoBase2.gameObject.SetActive(false);
|
||||
targetInfoBase3.gameObject.SetActive(false);
|
||||
if (eventTargetExtraDrop != null)
|
||||
{
|
||||
if (eventTargetExtraDrop is ETDropAfterDrop)
|
||||
{
|
||||
targetInfoBase2.SetData(eventTargetExtraDrop as ETDropAfterDrop);
|
||||
curTargetInfoBase = targetInfoBase2;
|
||||
}
|
||||
else if (eventTargetExtraDrop is ETNewItem)
|
||||
{
|
||||
targetInfoBase3.SetData(eventTargetExtraDrop as ETNewItem);
|
||||
curTargetInfoBase = targetInfoBase3;
|
||||
|
||||
}
|
||||
else if (eventTargetExtraDrop is ETDropByFish)
|
||||
{
|
||||
targetInfoBase1.SetData(eventTargetExtraDrop as ETDropByFish);
|
||||
curTargetInfoBase = targetInfoBase1;
|
||||
}
|
||||
}
|
||||
IUIService uIService = GContext.container.Resolve<IUIService>();
|
||||
for (int i = 0; i < curTargetInfoBase.icon_target.Count; i++)
|
||||
{
|
||||
uIService.SetImageSprite(curTargetInfoBase.icon_target[i], icon, BasePanel.PanelName);
|
||||
}
|
||||
}
|
||||
|
||||
//protected void OnDestroy()
|
||||
//{
|
||||
// UIManager.Instance.DestroyUI(UITypes.FishCardReviewPopupPanel);
|
||||
//}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f092e2a2b89479186faed4959bd14f8
|
||||
timeCreated: 1694176122
|
||||
53
Assets/Scripts/UI/FishingTarget/FishingTargetPopupPanel4.cs
Normal file
53
Assets/Scripts/UI/FishingTarget/FishingTargetPopupPanel4.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FishingTargetPopupPanel4 : FishingTargetPopupPanelBase
|
||||
{
|
||||
TMP_Text text_num;
|
||||
Image icon_target;
|
||||
|
||||
TMP_Text text_name;
|
||||
TMP_Text text_catch;
|
||||
GameObject text_nofound;
|
||||
protected override void Awake()
|
||||
{
|
||||
text_num = transform.Find("root/target_info/info/text_num").GetComponent<TMP_Text>();
|
||||
icon_target = transform.Find("root/target_info/info/text_num/icon_target").GetComponent<Image>();
|
||||
|
||||
text_name = transform.Find("root/target_info/card_info/card_1/bg/info/text_name").GetComponent<TMP_Text>();
|
||||
text_catch = transform.Find("root/target_info/card_info/card_1/bg/info/text_catch").GetComponent<TMP_Text>();
|
||||
text_nofound = transform.Find("root/target_info/card_info/card_1/bg/info/text_nofound").gameObject;
|
||||
base.Awake();
|
||||
}
|
||||
protected override void SetTargetExtra(string icon)
|
||||
{
|
||||
var tables = GContext.container.Resolve<Tables>();
|
||||
GContext.container.Resolve<IUIService>().SetImageSprite(icon_target, icon);
|
||||
EventTargetExtraDrop eventTargetExtraDrop = _fishingEventData.GetEventTargetExtraDrop();
|
||||
|
||||
if (eventTargetExtraDrop != null)
|
||||
{
|
||||
if (eventTargetExtraDrop is ETNewItem)
|
||||
{
|
||||
ETNewItem eTNewItem = eventTargetExtraDrop as ETNewItem;
|
||||
int DropID = eTNewItem.ExtraDropList[0];
|
||||
Drop drop = GContext.container.Resolve<Tables>().TbDrop[DropID];
|
||||
text_num.text = $"+{drop.DropList.DropCountList[0]}";
|
||||
|
||||
var fishItemIDs = eTNewItem.NewItemID;
|
||||
var fishItemID = fishItemIDs[0];
|
||||
var fishItem = tables.TbItem[fishItemID];
|
||||
int fishCount = _fishingEventData.GetEtDropAfterDropDic(fishItem.RedirectID);
|
||||
text_name.text = LocalizationMgr.GetText(fishItem.Name_l10n_key) + ":";
|
||||
text_catch.gameObject.SetActive(fishCount > 0);
|
||||
text_catch.text = LocalizationMgr.GetFormatTextValue("UI_FishingTargetPopupPanel_Advanced_3", fishCount);
|
||||
text_nofound.SetActive(fishCount == 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62f5aa59909616c4dbf5ba6a1f05d2cf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
193
Assets/Scripts/UI/FishingTarget/FishingTargetPopupPanelBase.cs
Normal file
193
Assets/Scripts/UI/FishingTarget/FishingTargetPopupPanelBase.cs
Normal file
@@ -0,0 +1,193 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FishingTargetPopupPanelBase : MonoBehaviour
|
||||
{
|
||||
protected FishingEventData _fishingEventData;
|
||||
Button btn_close;
|
||||
Button btn_mask;
|
||||
RewardItemNew require;
|
||||
TMP_Text text_info;
|
||||
|
||||
TMP_Text text_title;
|
||||
TMP_Text text_time;
|
||||
Timer timer;
|
||||
Transform beilvpanel_max;
|
||||
Transform bg_beilvlpanel;
|
||||
TMP_Text text_beilvpanel_content;
|
||||
|
||||
TargetReward target_reward;
|
||||
|
||||
CollectingTargetReward targetReward1;
|
||||
CollectingTargetReward targetReward2;
|
||||
CollectingTargetReward targetReward3;
|
||||
|
||||
List<ItemData> itemData1;
|
||||
List<ItemData> itemData2;
|
||||
List<ItemData> itemData3;
|
||||
|
||||
int targetCount1;
|
||||
int targetCount2;
|
||||
int targetCount3;
|
||||
|
||||
|
||||
|
||||
protected virtual void Awake()
|
||||
{
|
||||
target_reward = transform.Find("root/target_reward").GetComponent<TargetReward>();
|
||||
|
||||
_fishingEventData = GContext.container.Resolve<FishingEventData>();
|
||||
btn_close = transform.Find("btn_close").GetComponent<Button>();
|
||||
btn_mask = transform.Find("mask").GetComponent<Button>();
|
||||
require = transform.Find("root/target_reward/btn_icon/reward").GetComponent<RewardItemNew>();
|
||||
text_info = transform.Find("root/bg_info/text_info").GetComponent<TMP_Text>();
|
||||
text_title = transform.Find("root/text_title").GetComponent<TMP_Text>();
|
||||
text_time = transform.Find("root/text_time").GetComponent<TMP_Text>();
|
||||
|
||||
beilvpanel_max = transform.Find("root/beilvpanel/bg_beilv_max");
|
||||
if (beilvpanel_max)
|
||||
{
|
||||
bg_beilvlpanel = transform.Find("root/beilvpanel/bg_beilv");
|
||||
text_beilvpanel_content = transform.Find("root/beilvpanel/bg_beilv/text_beilv").GetComponent<TMP_Text>();
|
||||
}
|
||||
}
|
||||
protected void Start()
|
||||
{
|
||||
btn_close.onClick.AddListener(() => { UIManager.Instance.DestroyUI(UITypes.FishingTargetPopupPanel); });
|
||||
btn_mask.onClick.AddListener(() => { UIManager.Instance.DestroyUI(UITypes.FishingTargetPopupPanel); });
|
||||
Init();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
if (beilvpanel_max)
|
||||
{
|
||||
bool isMax = GContext.container.Resolve<PlayerData>().IsMaxMagnification();
|
||||
beilvpanel_max.gameObject.SetActive(isMax);
|
||||
bg_beilvlpanel.gameObject.SetActive(!isMax);
|
||||
text_beilvpanel_content.text = isMax ? "MAX" : $"x{GContext.container.Resolve<PlayerData>().GetMagnification()}";
|
||||
}
|
||||
}
|
||||
void Init()
|
||||
{
|
||||
CollectingTargetReward collectingTarget = _fishingEventData.collectingTarget;
|
||||
if (collectingTarget != null)
|
||||
{
|
||||
PlayerItemData playerItemData = GContext.container.Resolve<PlayerItemData>();
|
||||
var tables = GContext.container.Resolve<Tables>();
|
||||
CollectingTargetInit collectingTargetInit = _fishingEventData.collectingTargetInit;
|
||||
text_title.text = LocalizationMgr.GetText(collectingTargetInit.Title_l10n_key);
|
||||
|
||||
Item item = tables.TbItem[collectingTargetInit.TokenID];
|
||||
require.SetData(item, isCanClick: true);
|
||||
require.text_num.gameObject.SetActive(false);
|
||||
SetEndTime();
|
||||
SetTargetExtra(item.Icon);
|
||||
|
||||
var TargetList = collectingTargetInit.TargetList;
|
||||
|
||||
int curCount = _fishingEventData.GetCurCollectingTarget();
|
||||
int curIndex = TargetList.IndexOf(collectingTarget.TaskID);
|
||||
|
||||
text_info.text = LocalizationMgr.GetFormatTextValue("UI_EventRankPopupPanel_2", curIndex, TargetList.Count);
|
||||
float fillAmount = 1;
|
||||
if (collectingTarget.NextTarget <= 0)
|
||||
{
|
||||
if (curCount >= collectingTarget.TokenRequired)
|
||||
{
|
||||
target_reward.SetDone();
|
||||
text_info.text = LocalizationMgr.GetFormatTextValue("UI_EventRankPopupPanel_2", TargetList.Count, TargetList.Count);
|
||||
return;
|
||||
}
|
||||
//最后一个
|
||||
targetReward1 = tables.TbCollectingTargetReward.GetOrDefault(TargetList[^3]);
|
||||
targetReward2 = tables.TbCollectingTargetReward.GetOrDefault(TargetList[^2]);
|
||||
|
||||
fillAmount = 1;
|
||||
}
|
||||
else if (collectingTarget.TaskID == TargetList[0])
|
||||
{
|
||||
//第一个
|
||||
targetReward1 = collectingTarget;
|
||||
targetReward2 = tables.TbCollectingTargetReward.GetOrDefault(collectingTarget.NextTarget);
|
||||
|
||||
fillAmount = curCount / ((float)collectingTarget.TokenRequired * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetReward1 = tables.TbCollectingTargetReward.GetOrDefault(TargetList[curIndex - 1]);
|
||||
targetReward2 = collectingTarget;
|
||||
|
||||
fillAmount = curCount / ((float)collectingTarget.TokenRequired * 2) + 0.5f;
|
||||
}
|
||||
itemData1 = playerItemData.GetItemDataByDropId(targetReward1.DropID);
|
||||
itemData2 = playerItemData.GetItemDataByDropId(targetReward2.DropID);
|
||||
|
||||
target_reward.SetBar(fillAmount, itemData1, itemData2);
|
||||
if (collectingTarget.TaskID != TargetList[0])
|
||||
{
|
||||
target_reward.SetReceived1(true);
|
||||
}
|
||||
if (collectingTarget.NextTarget <= 0)
|
||||
{
|
||||
target_reward.SetReceived2(true);
|
||||
}
|
||||
CollectingTargetReward maxCollectingTarget = tables.TbCollectingTargetReward.GetOrDefault(TargetList[^1]);
|
||||
|
||||
//设置tips
|
||||
int targetCount = 0;
|
||||
for (int i = 0; i < TargetList.Count; i++)
|
||||
{
|
||||
var targetReward = tables.TbCollectingTargetReward.GetOrDefault(TargetList[i]);
|
||||
targetCount += targetReward.TokenRequired;
|
||||
if (targetReward.TaskID == targetReward1.TaskID)
|
||||
{
|
||||
targetCount1 = targetCount;
|
||||
}
|
||||
else if (targetReward.TaskID == targetReward2.TaskID)
|
||||
{
|
||||
targetCount2 = targetCount;
|
||||
}
|
||||
else if (targetReward.TaskID == maxCollectingTarget.TaskID)
|
||||
{
|
||||
targetCount3 = targetCount;
|
||||
}
|
||||
}
|
||||
|
||||
targetReward3 = maxCollectingTarget;
|
||||
itemData3 = playerItemData.GetItemDataByDropId(maxCollectingTarget.DropID);
|
||||
int allCount = _fishingEventData.GetAllCollectingTarget();
|
||||
target_reward.SetReward(itemData1, itemData2, itemData3, targetReward3.Milestone != 2, item.Icon, targetCount1, targetCount2, allCount);
|
||||
}
|
||||
}
|
||||
protected virtual void SetTargetExtra(string icon)
|
||||
{
|
||||
|
||||
}
|
||||
void SetEndTime()
|
||||
{
|
||||
//显示倒计时
|
||||
if (timer == null)
|
||||
{
|
||||
DateTime endDateTime = _fishingEventData.GetCollectingTargetEndTime();
|
||||
TimeSpan all = endDateTime - ZZTimeHelper.UtcNow().UtcNowOffset();
|
||||
double seconds = all.TotalSeconds;
|
||||
timer = this.AttachTimer((float)seconds,
|
||||
() => { UIManager.Instance.DestroyUI(UITypes.FishingTargetPopupPanel); },
|
||||
(elapsed) =>
|
||||
{
|
||||
TimeSpan now = endDateTime - ZZTimeHelper.UtcNow().UtcNowOffset();
|
||||
|
||||
text_time.text = ConvertTools.ConvertTime2(now.Days, now.Hours, now.Minutes, now.Seconds);
|
||||
}, useRealTime: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ea5def6a5074284e9df1feb0584ea7c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using TMPro;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class FishingTargetPopupPanelChangeMaterial : FishingTargetPopupPanelBase
|
||||
{
|
||||
TMP_Text text_num;
|
||||
Image icon_target;
|
||||
protected override void Awake()
|
||||
{
|
||||
text_num = transform.Find("root/target_info/info/text_num").GetComponent<TMP_Text>();
|
||||
icon_target = transform.Find("root/target_info/info/text_num/icon_target").GetComponent<Image>();
|
||||
base.Awake();
|
||||
}
|
||||
protected override void SetTargetExtra(string icon)
|
||||
{
|
||||
GContext.container.Resolve<IUIService>().SetImageSprite(icon_target, icon);
|
||||
EventTargetExtraDrop eventTargetExtraDrop = _fishingEventData.GetEventTargetExtraDrop();
|
||||
if (eventTargetExtraDrop != null)
|
||||
{
|
||||
if (eventTargetExtraDrop is ETDropAfterDrop)
|
||||
{
|
||||
int DropID = (eventTargetExtraDrop as ETDropAfterDrop).ExtraDropList[0];
|
||||
Drop drop = GContext.container.Resolve<Tables>().TbDrop[DropID];
|
||||
text_num.text = $"+{drop.DropList.DropCountList[0]}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e87ec4c60c5910647a9ceef719590027
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,58 @@
|
||||
using System.Collections.Generic;
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using GameCore;
|
||||
|
||||
public class FishingTargetPopupPanelNew : FishingTargetPopupPanelBase
|
||||
{
|
||||
HomeBuffItem buffItem;
|
||||
List<FishingTargetItem> fishingTargetItems;
|
||||
FishBuffTimeData buffTimeData;
|
||||
protected override void Awake()
|
||||
{
|
||||
fishingTargetItems = new List<FishingTargetItem>();
|
||||
for (int i = 1; i < 5; i++)
|
||||
{
|
||||
var item = transform.Find($"root/target_info/fish{i}").GetComponent<FishingTargetItem>();
|
||||
item.Init();
|
||||
fishingTargetItems.Add(item);
|
||||
}
|
||||
buffItem = transform.Find("root/btn_buff").GetComponent<HomeBuffItem>();
|
||||
base.Awake();
|
||||
}
|
||||
protected override void SetTargetExtra(string icon)
|
||||
{
|
||||
CollectingTargetInit collectingTargetInit = _fishingEventData.collectingTargetInit;
|
||||
EventTargetExtraDrop eventTargetExtraDrop = collectingTargetInit.FishingExtraDrop;
|
||||
|
||||
if (eventTargetExtraDrop is ETKeepsake)
|
||||
{
|
||||
IUIService uIService = GContext.container.Resolve<IUIService>();
|
||||
ETKeepsake etKeepsake = eventTargetExtraDrop as ETKeepsake;
|
||||
var tables = GContext.container.Resolve<Tables>();
|
||||
var fishItemIDs = etKeepsake.FishIDList;
|
||||
var fishDrapIDs = etKeepsake.FishExtraDropList;
|
||||
for (int i = 0; i < fishItemIDs.Count; i++)
|
||||
{
|
||||
var fishItemID = fishItemIDs[i];
|
||||
var fishItem = tables.TbItem[fishItemID];
|
||||
int fishCount = _fishingEventData.GetEtDropAfterDropDic(fishItem.RedirectID);
|
||||
var drop = tables.TbDrop[fishDrapIDs[i]];
|
||||
uIService.SetImageSprite(fishingTargetItems[i].icon_target, icon);
|
||||
fishingTargetItems[i].text_num.text = $"+{drop.DropList.DropCountList[0]}";
|
||||
fishingTargetItems[i].photo_nofound.SetActive(fishCount == 0);
|
||||
fishingTargetItems[i].text_name.text = LocalizationMgr.GetText(fishItem.Name_l10n_key) + ":";
|
||||
fishingTargetItems[i].text_catch.gameObject.SetActive(fishCount > 0);
|
||||
fishingTargetItems[i].text_catch.text = LocalizationMgr.GetFormatTextValue("UI_FishingTargetPopupPanel_Advanced_3", fishCount);
|
||||
fishingTargetItems[i].text_nofound.SetActive(fishCount == 0);
|
||||
}
|
||||
}
|
||||
SetBuffItem();
|
||||
}
|
||||
|
||||
void SetBuffItem()
|
||||
{
|
||||
buffTimeData = GContext.container.Resolve<BuffDataCenter>().GetBuffData<CollectionTargetExtraPoint>();
|
||||
buffItem.InitPanel(buffTimeData, "", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9e7e30c060d31eb40a78b23f5a0705d1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
35
Assets/Scripts/UI/FishingTarget/Rewardx1x2.cs
Normal file
35
Assets/Scripts/UI/FishingTarget/Rewardx1x2.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using GameCore;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Rewardx1x2 : MonoBehaviour
|
||||
{
|
||||
public GameObject rewardx2;
|
||||
public GameObject rewardx1;
|
||||
public RewardItemNew reward;
|
||||
public RewardItemNew reward1;
|
||||
public RewardItemNew reward2;
|
||||
|
||||
public void SetData(List<ItemData> itemDatas)
|
||||
{
|
||||
if (itemDatas != null)
|
||||
{
|
||||
int count = itemDatas.Count;
|
||||
rewardx1.SetActive(count == 1);
|
||||
rewardx2.SetActive(count != 1);
|
||||
|
||||
if (count == 1)
|
||||
{
|
||||
reward.SetData(itemDatas[0], forceLight: true);
|
||||
reward.id = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
reward1.SetData(itemDatas[0], forceLight: true);
|
||||
reward2.SetData(itemDatas[1], forceLight: true);
|
||||
reward1.id = 0;
|
||||
reward2.id = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/FishingTarget/Rewardx1x2.cs.meta
Normal file
11
Assets/Scripts/UI/FishingTarget/Rewardx1x2.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c485d74fcc59a6c428afbfea5a3bdeb9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
77
Assets/Scripts/UI/FishingTarget/TargetInfoBase.cs
Normal file
77
Assets/Scripts/UI/FishingTarget/TargetInfoBase.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using asap.core;
|
||||
using cfg;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class TargetInfoBase : MonoBehaviour
|
||||
{
|
||||
Tables _tables => GContext.container.Resolve<Tables>();
|
||||
public List<Image> images;
|
||||
public List<TMP_Text> texts;
|
||||
public List<Image> icon_target = new List<Image>();
|
||||
MapFishList mapFishList;
|
||||
List<FishData> _fishDatas;
|
||||
|
||||
//根据地图特定鱼掉落积分
|
||||
public void SetData(ETDropByFish eTDropByFish)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
List<MapFishList> _mapFishList = eTDropByFish.ExtraDropList;
|
||||
FishingData fishingData = GContext.container.Resolve<FishingData>();
|
||||
for (int i = 0; i < _mapFishList.Count; i++)
|
||||
{
|
||||
if (_mapFishList[i].MapID == fishingData.MapId)
|
||||
{
|
||||
mapFishList = _mapFishList[i];
|
||||
SetShowUI();
|
||||
gameObject.SetActive(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//根据颜色掉落积分
|
||||
public void SetData(ETDropAfterDrop eTDropAfterDrop)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
List<int> DropIDList = eTDropAfterDrop.ExtraDropList;
|
||||
Drop drop;
|
||||
for (int i = 0; i < DropIDList.Count; i++)
|
||||
{
|
||||
drop = _tables.TbDrop[DropIDList[i]];
|
||||
texts[i].text = drop.DropList.DropProbList[0].ToPercentageString();
|
||||
}
|
||||
}
|
||||
//额外的鱼
|
||||
public void SetData(ETNewItem eTNewItem)
|
||||
{
|
||||
gameObject.SetActive(true);
|
||||
Item item = _tables.TbItem[eTNewItem.NewItemID[0]];
|
||||
FishData fishData = _tables.TbFishData[item.RedirectID];
|
||||
GContext.container.Resolve<IUIService>().SetImageSprite(images[0], fishData.Portrait, BasePanel.PanelName);
|
||||
int dropID = eTNewItem.ExtraDropList[0];
|
||||
Drop drop = _tables.TbDrop[dropID];
|
||||
texts[0].text = $"+{drop.DropList.DropCountList[0]}";
|
||||
|
||||
//Drop drop = _tables.TbDrop[fishData.DropID];
|
||||
//texts[0].text = $"+{drop.DropList.DropCountList[2]}";
|
||||
}
|
||||
void SetShowUI()
|
||||
{
|
||||
FishData fishData;
|
||||
List<int> FishIDList = mapFishList.FishIDList;
|
||||
List<int> DropIDList = mapFishList.DropIDList;
|
||||
int count = FishIDList.Count;
|
||||
_fishDatas = new List<FishData>();
|
||||
|
||||
for (int i = 0; i < images.Count; i++)
|
||||
{
|
||||
fishData = _tables.TbFishData[FishIDList[i]];
|
||||
_fishDatas.Add(fishData);
|
||||
GContext.container.Resolve<IUIService>().SetImageSprite(images[i], fishData.Portrait, BasePanel.PanelName);
|
||||
Drop drop = _tables.TbDrop[DropIDList[i]];
|
||||
texts[i].text = $"+{drop.DropList.DropCountList[0]}";
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/FishingTarget/TargetInfoBase.cs.meta
Normal file
11
Assets/Scripts/UI/FishingTarget/TargetInfoBase.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7751e5b8e8de1894cba4c2f3f0ca99cd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
57
Assets/Scripts/UI/FishingTarget/TargetReward.cs
Normal file
57
Assets/Scripts/UI/FishingTarget/TargetReward.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using GameCore;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TargetReward : MonoBehaviour
|
||||
{
|
||||
target_reward_bar bar;
|
||||
public target_reward_bar_1 bar_1;
|
||||
public target_reward_bar_2 bar_2;
|
||||
public target_reward_big reward_big;
|
||||
public GameObject bg_bar_done;
|
||||
|
||||
public void SetDone()
|
||||
{
|
||||
bg_bar_done.SetActive(true);
|
||||
bar_1.gameObject.SetActive(false);
|
||||
bar_2.gameObject.SetActive(false);
|
||||
reward_big.gameObject.SetActive(false);
|
||||
bar = bar_1;
|
||||
}
|
||||
|
||||
public void SetBar(float fillAmount, List<ItemData> datas1, List<ItemData> datas2)
|
||||
{
|
||||
bool value = datas2.Count == 1;
|
||||
bar_1.gameObject.SetActive(value);
|
||||
bar_2.gameObject.SetActive(!value);
|
||||
bar = value ? bar_1 : bar_2;
|
||||
bar.bar.fillAmount = fillAmount;
|
||||
bar.SetReward(datas1, datas2);
|
||||
}
|
||||
|
||||
public void SetReceived1(bool received)
|
||||
{
|
||||
bar.SetReceived1(received);
|
||||
}
|
||||
public void SetReceived2(bool received)
|
||||
{
|
||||
bar.SetReceived2(received);
|
||||
}
|
||||
|
||||
public void SetReward(List<ItemData> itemDatas1,
|
||||
List<ItemData> itemDatas2,
|
||||
List<ItemData> itemDatas, bool big,
|
||||
string icon,
|
||||
int targetCount1,
|
||||
int targetCount2,
|
||||
int allCount)
|
||||
{
|
||||
|
||||
//设置奖励领取
|
||||
|
||||
bar.barItemTips[0].Init(itemDatas1, icon, targetCount1, allCount);
|
||||
bar.barItemTips[1].Init(itemDatas2, icon, targetCount2, allCount);
|
||||
|
||||
reward_big.SetData(itemDatas, big);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/FishingTarget/TargetReward.cs.meta
Normal file
11
Assets/Scripts/UI/FishingTarget/TargetReward.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6bdd5160c55857349b11b883b8168eb4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
29
Assets/Scripts/UI/FishingTarget/target_reward_bar.cs
Normal file
29
Assets/Scripts/UI/FishingTarget/target_reward_bar.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using GameCore;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class target_reward_bar : MonoBehaviour
|
||||
{
|
||||
public Image bar;
|
||||
public List<BarItemTips> barItemTips = new List<BarItemTips>();
|
||||
public virtual void SetReceived1(bool received)
|
||||
{
|
||||
|
||||
}
|
||||
public virtual void SetReceived2(bool received)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void SetReward(List<ItemData> datas1, List<ItemData> datas2)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnClickReward(int index)
|
||||
{
|
||||
barItemTips[index].gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
}
|
||||
11
Assets/Scripts/UI/FishingTarget/target_reward_bar.cs.meta
Normal file
11
Assets/Scripts/UI/FishingTarget/target_reward_bar.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b39e90c2eea59b242ad2e37438192921
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
61
Assets/Scripts/UI/FishingTarget/target_reward_bar_1.cs
Normal file
61
Assets/Scripts/UI/FishingTarget/target_reward_bar_1.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using GameCore;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class target_reward_bar_1 : target_reward_bar
|
||||
{
|
||||
public GameObject reward_1x1;
|
||||
public GameObject reward_1x2;
|
||||
public RewardItemNew reward1;
|
||||
public RewardItemNew reward11;
|
||||
public RewardItemNew reward12;
|
||||
public RewardItemNew reward2;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
reward1.btn_click.onClick.AddListener(() => OnClickReward(0));
|
||||
reward11.btn_click.onClick.AddListener(() => OnClickReward(0));
|
||||
reward12.btn_click.onClick.AddListener(() => OnClickReward(0));
|
||||
reward2.btn_click.onClick.AddListener(() => OnClickReward(1));
|
||||
}
|
||||
|
||||
public override void SetReceived1(bool received)
|
||||
{
|
||||
reward1.SetReceived(received);
|
||||
reward1.btn_click.enabled = false;
|
||||
reward11.SetReceived(received);
|
||||
reward11.btn_click.enabled = false;
|
||||
reward12.SetReceived(received);
|
||||
reward12.btn_click.enabled = false;
|
||||
}
|
||||
|
||||
public override void SetReceived2(bool received)
|
||||
{
|
||||
reward2.SetReceived(received);
|
||||
reward2.btn_click.enabled = false;
|
||||
}
|
||||
|
||||
public override void SetReward(List<ItemData> datas1, List<ItemData> datas2)
|
||||
{
|
||||
reward_1x1.SetActive(datas1.Count == 1);
|
||||
reward_1x2.SetActive(datas1.Count != 1);
|
||||
if (datas1.Count == 1)
|
||||
{
|
||||
reward1.SetData(datas1[0], forceLight: true);
|
||||
reward1.id = 0;
|
||||
}
|
||||
if (datas2.Count > 0)
|
||||
{
|
||||
reward2.SetData(datas2[0], forceLight: true);
|
||||
reward2.id = 0;
|
||||
}
|
||||
|
||||
if (datas1.Count != 1)
|
||||
{
|
||||
reward11.SetData(datas1[0], forceLight: true);
|
||||
reward11.id = 0;
|
||||
reward12.SetData(datas1[1], forceLight: true);
|
||||
reward12.id = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/FishingTarget/target_reward_bar_1.cs.meta
Normal file
11
Assets/Scripts/UI/FishingTarget/target_reward_bar_1.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 246ed220683d44b4b925fc22ad9929f3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
39
Assets/Scripts/UI/FishingTarget/target_reward_bar_2.cs
Normal file
39
Assets/Scripts/UI/FishingTarget/target_reward_bar_2.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using GameCore;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class target_reward_bar_2 : target_reward_bar
|
||||
{
|
||||
public RewardItemNew reward1;
|
||||
public RewardItemNew reward21;
|
||||
public RewardItemNew reward22;
|
||||
private void Awake()
|
||||
{
|
||||
reward1.btn_click.onClick.AddListener(() => OnClickReward(0));
|
||||
reward21.btn_click.onClick.AddListener(() => OnClickReward(1));
|
||||
reward22.btn_click.onClick.AddListener(() => OnClickReward(1));
|
||||
}
|
||||
|
||||
public override void SetReceived1(bool received)
|
||||
{
|
||||
reward1.SetReceived(received);
|
||||
reward1.btn_click.enabled = false;
|
||||
}
|
||||
|
||||
public override void SetReceived2(bool received)
|
||||
{
|
||||
reward21.SetReceived(received);
|
||||
reward21.btn_click.enabled = false;
|
||||
reward22.SetReceived(received);
|
||||
reward22.btn_click.enabled = false;
|
||||
}
|
||||
|
||||
public override void SetReward(List<ItemData> datas1, List<ItemData> datas2)
|
||||
{
|
||||
reward1.SetData(datas1[0], forceLight: true);
|
||||
reward1.id = 0;
|
||||
reward21.SetData(datas2[0], forceLight: true);
|
||||
reward21.id = 0;
|
||||
reward22.SetData(datas2[1], forceLight: true);
|
||||
reward22.id = 0;
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/FishingTarget/target_reward_bar_2.cs.meta
Normal file
11
Assets/Scripts/UI/FishingTarget/target_reward_bar_2.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26594d509ecffb940ba2f58acc889870
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
30
Assets/Scripts/UI/FishingTarget/target_reward_big.cs
Normal file
30
Assets/Scripts/UI/FishingTarget/target_reward_big.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using GameCore;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class target_reward_big : MonoBehaviour
|
||||
{
|
||||
public Rewardx1x2 rewardx1X2;
|
||||
public GameObject big_reward;
|
||||
public GameObject grand_reward;
|
||||
public EventTargetGrandPrizeTips grandPrizeTips;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
rewardx1X2.reward.btn_click.onClick.AddListener(ShowGrandPrizeTips);
|
||||
rewardx1X2.reward1.btn_click.onClick.AddListener(ShowGrandPrizeTips);
|
||||
rewardx1X2.reward2.btn_click.onClick.AddListener(ShowGrandPrizeTips);
|
||||
}
|
||||
|
||||
void ShowGrandPrizeTips()
|
||||
{
|
||||
grandPrizeTips.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void SetData(List<ItemData> itemDatas, bool big)
|
||||
{
|
||||
big_reward.SetActive(big);
|
||||
grand_reward.SetActive(!big);
|
||||
rewardx1X2.SetData(itemDatas);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/FishingTarget/target_reward_big.cs.meta
Normal file
11
Assets/Scripts/UI/FishingTarget/target_reward_big.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c614427455e2bdf4cbb41b27d9cdc070
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user