先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
73 lines
2.4 KiB
C#
73 lines
2.4 KiB
C#
using asap.core;
|
|
using game;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class TravelMapPanel : BasePanel
|
|
{
|
|
Button btn_close;
|
|
GameObject tips_noopen;
|
|
Transform item_wenli;
|
|
TraveMapScrollViewController tvc;
|
|
TraveMapDataManager mapDataManager;
|
|
TravelMapCtrl travelMapCtrl;
|
|
private void Awake()
|
|
{
|
|
Input.multiTouchEnabled = false;
|
|
travelMapCtrl = GContext.container.Resolve<TravelMapCtrl>();
|
|
mapDataManager = travelMapCtrl.traveMapDataManager;
|
|
tips_noopen = transform.Find("root/tips_noopen").gameObject;
|
|
tvc = transform.Find("root/ScrollView_map").GetComponent<TraveMapScrollViewController>();
|
|
btn_close = transform.Find("root/btn_close").GetComponent<Button>();
|
|
item_wenli = transform.Find("root/item_wenli");
|
|
}
|
|
protected override void Start()
|
|
{
|
|
tips_noopen.SetActive(false);
|
|
tvc.Init(tips_noopen, tvc, travelMapCtrl);
|
|
//tvc.cellViewVisibilityChanged = CellViewVisibilityChanged;
|
|
//tvc.cellViewWillRecycle = CellViewWillRecycle;
|
|
tvc.JumpToDataIndex(mapDataManager.index);
|
|
GetOperationItem();
|
|
//item_wenli.SetParent(tvc.Container, false);
|
|
//item_wenli.GetComponent<RectTransform>().anchoredPosition = new Vector2(0, 0);
|
|
//item_wenli.SetAsFirstSibling();
|
|
btn_close.onClick.AddListener(OnClose);
|
|
}
|
|
private void Update()
|
|
{
|
|
if (tvc != null && item_wenli != null)
|
|
{
|
|
item_wenli.position = tvc.Container.position;
|
|
}
|
|
//UpdateActionChain();
|
|
}
|
|
public async void GetOperationItem()
|
|
{
|
|
if (mapDataManager.IsVisit)
|
|
{
|
|
//如果已经访问过了
|
|
return;
|
|
}
|
|
if (tvc == null) return;
|
|
TraveMapItem traveMapItem = tvc.GetCurrentItem();
|
|
if (traveMapItem == null) return;
|
|
traveMapItem.PlayAni();
|
|
btn_close.gameObject.SetActive(false);
|
|
await Awaiters.Seconds(3);
|
|
GContext.Publish(new UnloadActToNextAct());
|
|
await Awaiters.Seconds(0.5f);
|
|
OnClose();
|
|
}
|
|
|
|
private void OnClose()
|
|
{
|
|
//RestartShowHomeUIEvent restartShowHomeUIEvent = new RestartShowHomeUIEvent();
|
|
//GContext.Publish(restartShowHomeUIEvent);
|
|
//GContext.Publish(new MapShowEvent() { isShow = true });
|
|
//关闭当前面板
|
|
travelMapCtrl.OnDestroy();
|
|
}
|
|
|
|
}
|