Ejemplo n.º 1
0
    public static void OnPlayerResurgence(SyncSession session, PlayerResurgence_s msg)
    {
        if(session.m_connect == null)
        {
            Debug.LogError("玩家不在游戏中!");
        }

        EntityBase entity = session.m_connect.Entity;

        LifeComponent lc = entity.GetComp<LifeComponent>();
        lc.life = lc.maxLife;

        entity.World.eventSystem.DispatchEvent(ServiceEventDefine.c_ComponentChange, entity);

        Debug.Log(" OnPlayerResurgence");
    }
    static void RecevicePlayerResurgence_s(SyncSession session, ProtocolRequestBase e)
    {
        PlayerResurgence_s msg = new PlayerResurgence_s();

        EventService.DispatchTypeEvent(session, msg);
    }