update: 2016/11/17
reference:
1. Understanding the Blueprint Function Library | Orfeas Eleftheriou
2. I touchs: Unreal: Adding a C++ Class
3. I touchs: Unreal: Exposing C++ variables to Blueprints
4. I touchs: Unreal: Exposing C++ functions to Blueprints
5. I touchs: Unreal: Add Override C++ Event Functions in Blueprints
A. 新增 C++ 類別
1. 可以接續 Unreal: Add Override C++ Event Functions in Blueprints 的專案
2. Add New > New C++ Class...
-----------------------------------------------------------------------------------------------
B. 新增函式宣告與內容:
1. 修改: MyHelperFunctions.h
....
class HELLOCPP_API UMyHelperFunctions : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
//@add ######
UFUNCTION(BlueprintCallable, Category = "MyOwnBlueprintFunctionLibrary")
void UsefulFunction();
};
....
....
//@add ######
void UMyHelperFunctions::UsefulFunction()
{
//TODO
}
....
3. 存檔並編譯
-----------------------------------------------------------------------------------------------
C. 從任何 Blueprint 呼叫函式:
1. 開啟任何 Blueprint (在此為 Level Blueprint)
2. 切換到 Event Graph 頁籤 > 取消勾選: Context Sensitive
> 選取搜尋到的 UsefulFunction
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。