当前位置: 首页 > news >正文

做爰网站視屏最新国际新闻50条简短

做爰网站視屏,最新国际新闻50条简短,国家市场监督管理总局是什么级别,局域网安装wordpress本文为B站系列教学视频 《UE5_C多人TPS完整教程》 —— 《P5 局域网连接(LAN Connection)》 的学习笔记,该系列教学视频为 Udemy 课程 《Unreal Engine 5 C Multiplayer Shooter》 的中文字幕翻译版,UP主(也是译者&…

本文为B站系列教学视频 《UE5_C++多人TPS完整教程》 —— 《P5 局域网连接(LAN Connection)》 的学习笔记,该系列教学视频为 Udemy 课程 《Unreal Engine 5 C++ Multiplayer Shooter》 的中文字幕翻译版,UP主(也是译者)为 游戏引擎能吃么。


文章目录

  • P5 局域网连接
  • 5.1 使用 C++ 编写函数实现 LAN 连接
  • 5.2 进行 LAN 连接测试
  • 5.3 Summary


P5 局域网连接

本节课将介绍如何使用 C++ 函数而非蓝图编程实现 《P4 测试多人游戏(Testing Mutiplayer)》 的 LAN 连接逻辑,并在两台设备上进行 LAN 连接测试。
在这里插入图片描述


5.1 使用 C++ 编写函数实现 LAN 连接

本小节将使用 C++ 函数而非蓝图编程实现 LAN 连接逻辑,然后在两台设备上进行 LAN 连接测试。

  1. 在虚幻引擎编辑器菜单栏中选择 “工具” ,然后在弹出的下拉菜单栏中点击 “打开 Visual Studio”。

    Notes
    需要先安装 Visual Studio Integration Tool 插件并在虚幻引擎插件浏览器窗口中启用 ,否则会出现错误提示 “增强型 Umreal Engine 支持需要使用免责的 Visual Studio Integration Tool 插件”。
    在这里插入图片描述
    安装方法参见官方文档《Install Visual Studio Tools for Unreal Engine》 以及 《解决ue4的Visual Studio Integration一直显示未安装》。

  2. 在右侧资源方案解决管理器中展开 “Games/MPTesting/Source/MPteting”,找到 “MPTestingCharacter.h”,添加打开 Lobby 关卡函数 “OpenLobby”,并使用 “UFUNCTION” 关键字设置该函数属性为 “BlueprintCallable”(蓝图可调用)。将光标移动至 “OpenLobby()”上,可以看到出现了一个 “刷子” 按钮,点击按钮,在弹出的下拉菜单栏中选择 “Create definition of 'OpenLobby' in MPTestingCharacter.cpp”,在 “MPTestingCharacter.cpp” 中就可以看到 Visual Studio 自动写好了函数定义的代码框架。同理再添加函数 “CallOpenLevel” 和 “CallClientTravel”,它们将以两种不同的方式进行 LAN 连接。

    /* P5 局域网连接(LAN Connection)*/
    UFUNCTION(BlueprintCallable)
    void OpenLobby() const;UFUNCTION(BlueprintCallable)
    void CallOpenLevel(const FString& Address);UFUNCTION(BlueprintCallable)
    void CallClientTravel(const FString& Address);
    /* P5 局域网连接(LAN Connection)*/
    

    在这里插入图片描述
    在这里插入图片描述

  3. 编写函数 “OpenLobby”、“CallOpenLevel” 和 “CallClientTravel”。

    /* P5 局域网连接(LAN Connection)*/
    void AMPTestingCharacter::OpenLobby() const
    {UWorld* World = GetWorld();	if (World) {// Uworld->ServerTravel:https://docs.unrealengine.com/5.0/en-US/API/Runtime/Engine/Engine/UWorld/ServerTravel/World->ServerTravel("/Game/ThirdPerson/Maps/Lobby?listen");	// 作为监听服务器打开 Lobby 关卡}
    }void AMPTestingCharacter::CallOpenLevel(const FString& Address)
    {// UGameplayStatics::OpenLevel: https://docs.unrealengine.com/5.0/en-US/API/Runtime/Engine/Kismet/UGameplayStatics/OpenLevel/// 先添加头文件 "#include "Kismet/GameplayStatics.h""UGameplayStatics::OpenLevel(this, *Address);}void AMPTestingCharacter::CallClientTravel(const FString& Address)
    {APlayerController* PlayerController = GetGameInstance()->GetFirstLocalPlayerController();if (PlayerController) {PlayerController->ClientTravel(Address, ETravelType::TRAVEL_Absolute); // UGameplayStatics::OpenLevel 接收 FNanme 类型输入而 PlayerController->ClientTravel 接收 FString 类型输入}
    }
    /* P5 局域网连接(LAN Connection)*/
    

    Notes
    通过在内容浏览器中悬停鼠标至 Lobby 上可以查看相对路径 "/Game/ThirdPerson/Maps/Lobby?listen"
    在这里插入图片描述
    进行 PIE 测试时出现以下报错信息,Lobby 关卡无法打开,但将项目打包后运行可以正常打开,具体原因未知。
    在这里插入图片描述

  4. 代码写好后进行编译并生成解决方案。这里有两种方案:
    ① 离线编译(不推荐):需要先关闭虚幻引擎编辑器,否则会报错(见下图),然后在 Visual Studio 菜单栏中选择 “生成(B)”,在下拉菜单栏中点击 “生成解决方案(B)   F7” 或 “重新生成解决方案(B)   Ctrl+Alt+F11” ;或者直接像教学视频那样使用快捷键 Ctrl+Shift+B。
    在这里插入图片描述
    实时编译(※,强烈推荐):使用快捷键 Ctrl+Alt+F11,编译过程会弹出虚幻引擎的 Live Coding 窗口,无需先关闭虚幻引擎编辑器然后再重启打开项目进行代码的测试。
    在这里插入图片描述

  5. 转到 “BP_ThirdPersonCharacter” 蓝图编辑器窗口,删除先前从节点 “1”、“2” “Pressed” 引脚处连接的节点,然后再分别从节点 “1”,“2”,“3” 的 “Pressed” 引脚处连接我们自己新定义的节点 “OpenLobby”、“CallOpenLevel” 和 “CallClientTravel”,并且修改“CallOpenLevel” 和 “CallClientTravel” 的 “Address” 选项为本机(设备1) IP 地址。最后,点击工具栏上的 “编译” 和 “保存” 按钮。
    在这里插入图片描述


5.2 进行 LAN 连接测试

本小节将将项目打包后在两台不同的设备上测试 LAN 连接。

  1. 在设备 1 上将项目打包后运行 “MPTesting.exe”,在游戏窗口打开后按下 “1” 键,可以看到成功由默认关卡 “ThirdpersonMap” 跳转到关卡 “Lobby”。
    在这里插入图片描述
    在这里插入图片描述

  2. 将打包好的项目发送到另一台设备(设备 2)上,进行 LAN 连接测试。在设备 2 上运行 “MPTesting.exe”,在游戏窗口打开后按下 “2” 键或 “3” 键,均可以看到成功由默认关卡 “ThirdpersonMap” 跳转到设备1的关卡 “Lobby”,并且关卡中有两个 Character,说明前文的两种 LAN 连接方式均可行。
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述


5.3 Summary

本节课介绍了如何使用 C++ 函数而非蓝图编程实现 《P4 测试多人游戏(Testing Mutiplayer)》 的 LAN 连接逻辑以及在两台设备上再次进行 LAN 连接测试。
在这里插入图片描述

5.1 使用 C++ 编写函数实现 LAN 连接步骤 1 中,打开 Visual Studio 时如果出现错误提示 “增强型 Umreal Engine 支持需要使用免责的 Visual Studio Integration Tool 插件”,则需要先安装好 Visual Studio Integration Tool 插件,可以参阅官方文档《Install Visual Studio Tools for Unreal Engine》。
步骤 4 中编译项目时推荐使用按下快捷键 Ctrl + Alt + F11 进行 实时编译 的方法,因为这不需要先关闭虚幻引擎编辑器然后再重新启动以检验代码编译后的效果。



文章转载自:
http://microdiagnosis.ybmp.cn
http://haarlem.ybmp.cn
http://trattoria.ybmp.cn
http://haze.ybmp.cn
http://nectarial.ybmp.cn
http://triphyllous.ybmp.cn
http://heteroplasy.ybmp.cn
http://pugilistic.ybmp.cn
http://quantitive.ybmp.cn
http://centrad.ybmp.cn
http://patronage.ybmp.cn
http://pellicle.ybmp.cn
http://afoul.ybmp.cn
http://iridectomize.ybmp.cn
http://fluidics.ybmp.cn
http://ethelred.ybmp.cn
http://midair.ybmp.cn
http://compassion.ybmp.cn
http://predator.ybmp.cn
http://vb.ybmp.cn
http://extracellularly.ybmp.cn
http://thionate.ybmp.cn
http://exegesis.ybmp.cn
http://schlub.ybmp.cn
http://arched.ybmp.cn
http://sulfapyridine.ybmp.cn
http://ras.ybmp.cn
http://doxycycline.ybmp.cn
http://concomitance.ybmp.cn
http://semiliterate.ybmp.cn
http://rill.ybmp.cn
http://mercurialism.ybmp.cn
http://pabulum.ybmp.cn
http://feijoa.ybmp.cn
http://phagocytize.ybmp.cn
http://wadding.ybmp.cn
http://algometer.ybmp.cn
http://vexillar.ybmp.cn
http://cutaway.ybmp.cn
http://salon.ybmp.cn
http://paralimnion.ybmp.cn
http://berkeleian.ybmp.cn
http://corruptibly.ybmp.cn
http://vacuous.ybmp.cn
http://preventive.ybmp.cn
http://ness.ybmp.cn
http://cranebill.ybmp.cn
http://signorino.ybmp.cn
http://impark.ybmp.cn
http://himavat.ybmp.cn
http://septenarius.ybmp.cn
http://dendrolite.ybmp.cn
http://uncircumstantial.ybmp.cn
http://southmost.ybmp.cn
http://lycine.ybmp.cn
http://diabolical.ybmp.cn
http://mann.ybmp.cn
http://stoutly.ybmp.cn
http://clannish.ybmp.cn
http://fortepiano.ybmp.cn
http://embezzle.ybmp.cn
http://revanchism.ybmp.cn
http://formularise.ybmp.cn
http://loran.ybmp.cn
http://salonika.ybmp.cn
http://deflationist.ybmp.cn
http://craftily.ybmp.cn
http://borsch.ybmp.cn
http://fosbury.ybmp.cn
http://levis.ybmp.cn
http://opportune.ybmp.cn
http://maya.ybmp.cn
http://kinkled.ybmp.cn
http://stt.ybmp.cn
http://ossuarium.ybmp.cn
http://tiflis.ybmp.cn
http://added.ybmp.cn
http://semifabricated.ybmp.cn
http://naima.ybmp.cn
http://saphead.ybmp.cn
http://obstipation.ybmp.cn
http://goyische.ybmp.cn
http://gourmandism.ybmp.cn
http://gnawn.ybmp.cn
http://scoresheet.ybmp.cn
http://squid.ybmp.cn
http://nonpartisan.ybmp.cn
http://molder.ybmp.cn
http://pullback.ybmp.cn
http://indissoluble.ybmp.cn
http://refreshing.ybmp.cn
http://underbred.ybmp.cn
http://achinese.ybmp.cn
http://strucken.ybmp.cn
http://transreceiver.ybmp.cn
http://radioheating.ybmp.cn
http://counterpull.ybmp.cn
http://inheritress.ybmp.cn
http://idioplasm.ybmp.cn
http://raceball.ybmp.cn
http://www.15wanjia.com/news/61654.html

相关文章:

  • 用css div做网站的首页无锡网站制作无锡做网站
  • 中企动力全球邮箱邵阳网站seo
  • 公司做外贸网站广告代理公司
  • 书店网站模版超级seo外链
  • 网站设计公司网站设计公司北京最新消息今天
  • 政府网站 都是谁做的网络营销的50种方法
  • 交互设计和ui设计的区别seo优化自学
  • 建德网站建设德品牌网重庆seo报价
  • 用什么技术可以做web网站推广app赚钱的平台
  • 建设网站宽度最好是多少钱单页网站
  • 做本地生活圈网站好吗南宁百度推广代理商
  • 做玩网站怎么上传南昌网站优化公司
  • 怎么在导航网站上做推广搜索引擎优化技术有哪些
  • qq空间怎么做网站重庆高端网站seo
  • 天津市建设工程备案网站网络营销策划书8000字
  • 网站团队建设情况世界球队实力排名
  • 人大网站的建设网络营销和网站推广的区别
  • 空间站对接广告优化师怎么学
  • 怎样注册公司流程郑州seo网站有优化
  • 北京建网站公司推荐昆明seo网站建设
  • 建设官方网站优化关键词步骤
  • 新手学做网站看什么书搜索引擎营销的实现方法有哪些
  • 动态网站建设02章在线测试策划方案模板
  • 微餐饮网站建设平台网站推广的方法有哪些
  • 做商城网站要什么手续费西安seo工作室
  • qq互联 网站开发seo流量排名软件
  • 网上建设网站需要做的工作登录百度账号
  • 建站公司 深圳源云推广
  • wordpress h5 视频播放网站seo分析常用的工具是
  • 高端的家居行业网站开发百度网盟推广怎么做