Kismet库
蓝图方法cpp使用
例:打LOG:Print String
蓝图节点的鼠标tips:Target is Kismet System Library
#include "Runtime/Engine/Classes/Kismet/KismetSystemLibrary.h"
UKismetSystemLibrary::PrintString(this, s) //KismetSystemLibrary 继承UObject
C++打LOG
DEFINE_LOG_CATEGORY_STATIC(LogName, Log, All); //.cpp文件声明LOG。注:LogName不能重,Log是个枚举,All是个枚举
UE_LOG(LogName, Log, TEXT("abc %s"),s);//可以像Printf样打印出
DECLARE_LOG_CATEGORY_EXTERN(AAAAA, Log, All); //在.h文件声明LOG
DEFINE_LOG_CATEGORY(AAAAA);//在.cpp文件使用
#include "Engine/Engine.h"
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("%s %f"), *Msg, Value));//引擎打LOG
蓝图 C++ 互调
UFUNCTION(BlueprintCallable, Category = "test")
void SendMsg(FString msg);//蓝图输入函数
UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "ReceiveEvent"))
void ReceiveEvent(const FString& message);//蓝图接收函数
UFUNCTION(BlueprintPure, Category = "TAMediator") //蓝图输出 绿色
原文地址:https://www.cnblogs.com/mattins/p/9234444.html
时间: 2024-10-11 07:05:52