public static void OnRoleOperation_DeleteRoleReturn(byte[] buffer)
    {
        RoleOperation_DeleteRoleReturnProto proto = RoleOperation_DeleteRoleReturnProto.GetProto(buffer);

#if DEBUG_LOG_PROTO
        Debug.Log("<color=#00eaff>接收消息:</color><color=#00ff9c>" + proto.ProtoEnName + " " + proto.ProtoCode + "</color>");
        Debug.Log("<color=#c5e1dc>==>>" + JsonUtility.ToJson(proto) + "</color>");
#endif
        if (proto.IsSuccess)
        {
            GameEntry.UI.OpenDialog(new DialogParams()
            {
                Mode    = 1,
                Title   = "提示",
                Message = "删除角色成功",
            });
            //删除角色成功
            GameEntry.Event.CommonEvent.Dispatch(GameEntry.Socket.MainSocket, GameEntry.Pool.SpawnClassObject <DeleateRoleSuccessGameEvent>());
        }
        else
        {
            GameEntry.UI.OpenDialog(new DialogParams()
            {
                Mode    = 1,
                Title   = "提示",
                Message = "删除角色失败",
            });
        }
    }
Exemplo n.º 2
0
    public static void OnRoleOperation_DeleteRoleReturn(byte[] buffer)
    {
        RoleOperation_DeleteRoleReturnProto proto = RoleOperation_DeleteRoleReturnProto.GetProto(buffer);

#if DEBUG_LOG_PROTO
        Debug.Log("<color=#00eaff>接收消息:</color><color=#00ff9c>" + proto.ProtoEnName + " " + proto.ProtoCode + "</color>");
        Debug.Log("<color=#c5e1dc>==>>" + JsonUtility.ToJson(proto) + "</color>");
#endif
    }
    /// <summary>
    /// 服务器返回删除角色的消息
    /// </summary>
    /// <param name="p"></param>
    private void OnDeleteRoleReturn(byte[] p)
    {
        RoleOperation_DeleteRoleReturnProto proto = RoleOperation_DeleteRoleReturnProto.GetProto(p);

        if (proto.IsSuccess)
        {
            //删除角色成功
            DeleteRole(m_currentRoleId);
            Debug.Log("删除角色成功");
        }
        else
        {
            UIMessageCtr.Instance.Show("提示", "删除角色失败");
        }
    }