虚幻引擎4-UE4 语言基础之「常用功能介绍:日志、射线、组件、
1、UE4的调试输出



2、在场景中查找对象

3、射线的使用

4、场景捕获组件的使用




5、XML文件的使用 initgameValue.xml文件内容如下
需要在build.cs文件中添加模块”XmlParser”,在YourCode.h中包含XmlParser.h
<Value>
<ChildrenSex>GirlChildrenSex>
<SceneIndex>0SceneIndex>
<Value>
解析代码如下:

6、UE4字符类型到基本数据类型的转换
UnrealString.h下的内联函数如下:

例:
#include "UnrealString.h"
using namespace LexicalConversion;
FString temp = "3.1415926":
float outFloat; FromString(outFloat, *temp);
7、UMG拖拽图标的实现
a、重载On Mouse Button Down函数
新建UserWidget组件,在Graph事件图表中重载该函数实现检测是否触发拖拽事件

b、重载OnDrag Detected函数
重载OnDrag Detected函数,处理拖拽逻辑
@parm payload是用于传递的参数 会在On Drop函数中用到
@parm defaultdragvisual是用于拖拽时跟随的图标

c、重载On Drop函数
此时Operation中的Payload参数便是CreateDragDropOperation中的传递过来的Payload参数
8、UE4官方文档&Answer Hub
1、官方文档 :https://docs.unrealengine.com/latest/INT/
2、Answer Hub :https://answers.unrealengine.com/index.html