unitId 是 Unit 的 instanceId。
ET中的actor机制,是可以将消息发送给 任何挂在了 MailBoxComponent 的 Entity
唯一需要的钥匙就是 actorId 。这个actorId就是 Entity的 instanceId。
那么问题来了
case IActorLocationMessage actorLocationMessage:
{
long unitId = session.GetComponent<SessionPlayerComponent>().Player.UnitId;
ActorLocationSenderComponent.Instance.Send(unitId, actorLocationMessage);
break;
}
上列代码中,ActorLocationSenderComponent.Instance.Send 这个方法 unitId 和 actorLocationMessage.actorId 不是重复了么?
根本不需要两个参数啊?
ActorLocationSenderComponent.Instance.Send(actorLocationMessage);
所以是我哪里理解错了,还是这样设计有其他用处。
(ps:发现论坛提问不太踊跃,我决定每天都来这边提新手问题。谢谢大家。