先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
74 lines
2.8 KiB
C#
74 lines
2.8 KiB
C#
using asap.core;
|
|
using cfg;
|
|
using GameCore;
|
|
using UnityEngine;
|
|
using UnityEngine.Assertions;
|
|
using UnityEngine.UI;
|
|
|
|
public class CommunityGuidancePanel : MonoBehaviour
|
|
{
|
|
[SerializeField] private Button btnClose;
|
|
private Tables _tables;
|
|
private TbJoinUs _tableJoin;
|
|
private TbDrop _tableDrop;
|
|
private TbItem _tableItem;
|
|
private PlayerItemData _playerItemData;
|
|
private IFootPrintService _footPrintService;
|
|
|
|
[SerializeField] private CommunityGuidanceSlot[] communityGuidanceSlots;
|
|
|
|
// Start is called before the first frame update
|
|
private void Start()
|
|
{
|
|
btnClose.onClick.AddListener(OnClickClose);
|
|
_tables = GContext.container.Resolve<Tables>();
|
|
_tableDrop = _tables.TbDrop;
|
|
_tableJoin = _tables.TbJoinUs;
|
|
_tableItem = _tables.TbItem;
|
|
_playerItemData = GContext.container.Resolve<PlayerItemData>();
|
|
GContext.container.Resolve<FishingEventData>();
|
|
_footPrintService = GContext.container.Resolve<IFootPrintService>();
|
|
int tbCount = _tableJoin.DataList.Count, prefabCount = communityGuidanceSlots.Length;
|
|
Assert.IsTrue(tbCount == prefabCount,
|
|
$"Quantity mismatch: {tbCount} records found in table and {prefabCount} prefabs found in GameObject.");
|
|
_footPrintService.UpdateFootPrint(EFootPrint.HasCommunityGuidancePanelBeenOpened);
|
|
string channel = ChannelManager.CurrentChannel.ToString();
|
|
for (int i = 0; i < tbCount; i++)
|
|
{
|
|
communityGuidanceSlots[i].Init(new CommunityGuidanceCtx(_tableJoin.DataList[i].Url,
|
|
_tableJoin.DataList[i].Reward, _tableDrop, _tableItem, _playerItemData,
|
|
_footPrintService, i + 1, _tableJoin.DataList[i].Name, _tableJoin.DataList[i].Channel.Count == 0 || _tableJoin.DataList[i].Channel.Contains(channel)));
|
|
}
|
|
}
|
|
|
|
private void OnClickClose()
|
|
{
|
|
UIManager.Instance.DestroyUI(UITypes.CommunityGuidancePanel);
|
|
}
|
|
|
|
public class CommunityGuidanceCtx
|
|
{
|
|
public readonly string Url;
|
|
public readonly int DropId, Index;
|
|
public readonly TbDrop TableDrop;
|
|
public readonly TbItem TableItem;
|
|
public readonly PlayerItemData PlayerItemData;
|
|
public readonly IFootPrintService FootPrintService;
|
|
public readonly string Name;
|
|
public readonly bool Show;
|
|
|
|
public CommunityGuidanceCtx(string url, int dropId, TbDrop drop, TbItem item,
|
|
PlayerItemData playerItemData, IFootPrintService footPrintService, int idx, string name, bool show)
|
|
{
|
|
Url = url;
|
|
DropId = dropId;
|
|
TableDrop = drop;
|
|
TableItem = item;
|
|
PlayerItemData = playerItemData;
|
|
FootPrintService = footPrintService;
|
|
Index = idx;
|
|
Name = name;
|
|
Show = show;
|
|
}
|
|
}
|
|
} |