CTT/Unity/Assets/HotfixView/Event/UI/UpdateNPCTaskStateEvent.cs

31 lines
824 B
C#

using ET.EventType;
using ET;
using System;
using System.Collections.Generic;
namespace ET
{
public class UpdateNPCTaskStateEvent : AEvent<UpdateNPCTaskState>
{
public override async ETTask Run(UpdateNPCTaskState args)
{
try
{
Unit unit = args.unit;
FUI_TaskTipUI taskStateUI = unit.GetComponent<FUI_TaskTipUI>();
if (!taskStateUI)
{
Log.Error($"taskStateUI is invalid where unitId = {unit.ConfigId}");
return;
}
taskStateUI.m_taskState.selectedIndex = (int)args.taskState;
}
catch (Exception e)
{
Log.Error(e);
}
await ETTask.CompletedTask;
}
}
}