先修复一下,错误的场景 删除不必要的钓场资产 修复into场景 update:更新meta文件,修复报错 update:修复资源 修复第一章节建造 修复建造第三章 update:删除多余内容 update:更新README.md update:还原图标 update:更新README update:更新配置
53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using asap.core;
|
|
using UnityEngine;
|
|
using UniRx;
|
|
using System;
|
|
using GameCore;
|
|
using UnityEngine.UI;
|
|
using cfg;
|
|
using Game;
|
|
|
|
public class HomeTargetBuffPopupPanel : MonoBehaviour
|
|
{
|
|
Image icon_buff;
|
|
IDisposable disposable;
|
|
private void Awake()
|
|
{
|
|
icon_buff = transform.Find("root/icon_buff").GetComponent<Image>();
|
|
disposable = GContext.OnEvent<GetBuffPosEvent>().Subscribe(GetBuffPosEvent);
|
|
}
|
|
void GetBuffPosEvent(GetBuffPosEvent getBuffPosEvent)
|
|
{
|
|
getBuffPosEvent.Pos = icon_buff.transform.position;
|
|
}
|
|
private void Start()
|
|
{
|
|
var targetWeightInit = GContext.container.Resolve<FishingEventData>().collectingTargetInit;
|
|
if (targetWeightInit != null)
|
|
{
|
|
GContext.container.Resolve<IUIService>().SetImageSprite(icon_buff, targetWeightInit.BuffIcon);
|
|
}
|
|
FishBuffTimeData buffData = GContext.container.Resolve<BuffDataCenter>().GetBuffData<CollectionTargetWeight>();
|
|
if (buffData != null)
|
|
{
|
|
FishBuff fishBuff = GContext.container.Resolve<Tables>().TbFishBuff.GetOrDefault(buffData.buffID);
|
|
if (fishBuff != null)
|
|
{
|
|
GContext.Publish(new EventUISound(fishBuff.Audio));
|
|
}
|
|
}
|
|
Close();
|
|
}
|
|
async void Close()
|
|
{
|
|
await Awaiters.Seconds(2.5f);
|
|
await Awaiters.NextFrame;
|
|
UIManager.Instance.DestroyUI(UITypes.HomeTargetBuffPopupPanel);
|
|
}
|
|
private void OnDisable()
|
|
{
|
|
disposable?.Dispose();
|
|
disposable = null;
|
|
}
|
|
}
|