public void SendEvent <E>(EventSendType sendType, E _event) where E : ISystemEvent
    {
        if (CheckEvent <E>())
        {
            return;
        }

        _event.SendType = sendType;
        events.Add(typeof(E), _event);
    }
    public void SendEntityEvent <E>(int entityId, EventSendType sendType, E _event) where E : IEntityEvent
    {
        var pool = GetEntityEventPool <E>();

        _event.SendType = sendType;
        _event.entityId = entityId;
        if (pool.cachedNodes.Count > 0)
        {
            var node = pool.cachedNodes.Last;
            pool.cachedNodes.Remove(node);
            node.Value = _event;
            pool.events.AddLast(node);
        }
        else
        {
            pool.events.AddLast(_event);
        }
    }
 protected void SendEvent <E>(EventSendType sendType, E _event) where E : ISystemEvent
 {
     SystemEnvironment.EventRoute.SendEvent(sendType, _event);
 }
예제 #4
0
 protected void SendEntityEvent <E>(int entityId, EventSendType sendType, E _event) where E : IEntityEvent
 {
     EventRoute.SendEntityEvent <E>(entityId, sendType, _event);
 }