CTT/Unity/Assets/HotfixView/Event/OnCreateTransPointEvent.cs

26 lines
749 B
C#

using Cal.DataTable;
using ET.EventType;
using ET;
using System;
using System.Collections.Generic;
using UnityEngine;
namespace ET
{
public class OnCreateTransPointEvent : AEvent<OnCreateTransPoint>
{
public override async ETTask Run(OnCreateTransPoint args)
{
Unit unit = args.unit;
Transform go = await ResourceViewHelper.LoadPrefabAsync(Sys_PrefabId.SceneTransPoint);
unit.AddComponent<UnitView,GameObject>(go.gameObject);
MonoSceneTranPoint monoTransPoint = go.gameObject.GetOrAddComponent<MonoSceneTranPoint>();
monoTransPoint.Id = unit.Id;
monoTransPoint.zoneScene = args.zoneScene;
await ETTask.CompletedTask;
}
}
}