using ET.EventType; using ET; using System; using System.Collections.Generic; using UnityEngine; namespace ET { public class OnCreateNPCEvent : AEvent { public override async ETTask Run(OnCreateUNPC args) { try { Unit unit = args.unit; GameObject go = (await ResourceViewHelper.LoadPrefabAsync(args.prefabId)).gameObject; unit.AddComponent(go); NPCHudComponent.Instance.Init(unit); } catch (Exception e) { Log.Error(e); } await ETTask.CompletedTask; } } }