ue4 代码入门

官网:暴露游戏元素给蓝图

https://docs.unrealengine.com/latest/CHN/Engine/Blueprints/TechnicalGuide/ExtendingBlueprints/index.html


官网:创建类的基础知识(代码,蓝图,蓝图调用c++,c++可以直接调用蓝图方法)

https://docs.unrealengine.com/latest/CHN/Gameplay/ClassCreation/index.html




--------------------------------------------------------------------------------------------------------------------------------------

编程指南(入门比较全面,创建使用组件等基本操作,umg)

https://docs.unrealengine.com/latest/CHN/Programming/index.html



官网:UE4中的c++编程介绍,基础且重要,入门比较好的教程(翻译有的位置不准确)

里面涉及的的事件处理方法的两个关键字,下面单独说明

http://blog.csdn.net/onafioo/article/details/77879395


BlueprintImplementableEvent用法,简单说就是c++中的空回调函数,然后到蓝图中实现具体方法

http://aigo.iteye.com/blog/2272292


BlueprintNativeEvent用法

http://aigo.iteye.com/blog/2269592


UFUNCTION(BlueprintNativeEvent, Category = "Game")  
int32 AAAA();  
int32 AAAA_Implementation();  
这样定以后,会优先调用蓝图中的Event,如果蓝图中该Event没有方法体,则调用C++的方法_Implementation


https://docs.unrealengine.com/latest/CHN/Programming/Tutorials/VariablesTimersEvents/2/index.html

和 UPROPERTY 宏一样,我们需要提供可使用它进行何种操作的信息,以便为非编程开发者启用更多功能和访问权。可以考虑三种选择:

  1. BlueprintCallable 函数在 C++ 中进行编写,可从 蓝图图表 进行调用。但必须编辑 C++ 代码方可对其进行变更和覆写。以这种方式进行标记的函数通常是非程序员使用的功能,但这些功能不应被改变,或改变后不存在实际意义。简单的例子就是任意类型的数学函数。

  2. BlueprintImplementableEvent 函数在 C++ header (.h) 文件中进行设置,但函数主体完全在蓝图图表中进行编写,而非 C++ 中。它们创建的目的是使非程序员可针对特殊情况(这些情况不存在默认操作或标准行为)创建自定义响应。范例:在宇宙飞船游戏中玩家飞船获得强化道具时发生的事件。

  3. BlueprintNativeEvent 函数就像是 BlueprintCallable 和 BlueprintImplementableEvent 函数的组合。它们的默认行为已在 C++ 中完成编程,但通过蓝图图表中的覆写即可对它们进行补充或替换。对它们进行编程时,C++ 代码始终将进入命名尾部添加有 _Implementation 的虚拟函数,如下所示。这是灵活性最高的选项,因此我们将在此教程中使用。


官网 这个定时器demo直接演示了在代码基础上直接继承蓝图的实例

https://docs.unrealengine.com/latest/CHN/Programming/Tutorials/VariablesTimersEvents/3/index.html

--------------------------------------------------------------------------------------------------------------------------------------


原文地址:https://www.cnblogs.com/nafio/p/9137083.html