zxl
/
CTT
forked from Cal/CTT
1
0
Fork 0
CTT/Server/Hotfix/Game/Event/OnCreateUnitEvent.cs

25 lines
718 B
C#
Raw Normal View History

2021-04-08 20:09:59 +08:00
using ET.EventType;
using System;
using System.Collections.Generic;
namespace ET
{
public class OnCreateUnitEvent : AEvent<OnCreateUnit>
{
public override async ETTask Run(OnCreateUnit args)
{
M2C_CreateMapMonster pproto = new M2C_CreateMapMonster
{
Id = args.unit.Id,
X = args.pos.x,
Y = args.pos.y,
ConfigId=args.configId,
MapMonsterType = (int)args.monsterType
};
2021-04-11 19:50:39 +08:00
Unit unit = MapUnitComponent.Instance.Get(args.Actor_UnitId);
2021-04-08 20:09:59 +08:00
unit.GetComponent<BrocastComponent>().BrocastInterval(pproto);
await ETTask.CompletedTask;
}
}
}