You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
527 B
21 lines
527 B
namespace ET |
|
{ |
|
[MessageHandler] |
|
public class M2C_CreateUnitsHandler : AMHandler<M2C_CreateUnits> |
|
{ |
|
protected override void Run(Session session, M2C_CreateUnits message) |
|
{ |
|
Scene currentScene = session.DomainScene().CurrentScene(); |
|
UnitComponent unitComponent = currentScene.GetComponent<UnitComponent>(); |
|
|
|
foreach (UnitProto unitInfo in message.Units) |
|
{ |
|
if (unitComponent.Get(unitInfo.Id) != null) |
|
{ |
|
continue; |
|
} |
|
Unit unit = UnitFactory.Create(currentScene, unitInfo); |
|
} |
|
} |
|
} |
|
}
|
|
|