//定义了一个名字叫做num的数据 const int num1 = 200;//用const修饰的常量是无法修改的 UE_LOG(LogTemp,Warning,TEXT("Hellow World C++! num=%d"),num);//num=%d(整数) UE_LOG(LogTemp, Warning, TEXT("#define day=%d"), day); UE_LOG(LogTemp, Warning, TEXT("const num1=%d"), num1)...
//单播代理,代理名字开头写F//只能绑定一个函数DECLARE_DELEGATE(FTest1);//无参数无返回DECLARE_DELEGATE_TwoParams(FTest2,float,constFString&);//2个参数无返回DECLARE_DELEGATE_RetVal_TwoParams(int32,FTest3,float,constFString&);//2个参数有返回//使用:FTest3test3;int32AMyActor::Fun(floata,constFS...
TSubclassOf<UKeyBoardWidget> KeyWidgetClass = LoadClass<UKeyBoardWidget>(nullptr,TEXT("WidgetBlueprint'/Game/UI/Widget_KeyBoard.Widget_KeyBoard_C'"));for(auto item:KeyInfoArray) {boolisValid =false; FKey TargetKey;//检测用户的按键if(item->isAxis) {constTArray<FInputAxisKeyMapping> AxisArray...
<regex>:可以直接使用,但其使用应封装在仅和编辑器有关的代码中。 <cmath>: 这个头文件中只有浮点比较函数可以使用。 nullptr 所用情况下均使用 nullptr,而非C-style NULL 宏。 常量const的使用: 1) 不修改参数,常量指针或引用将传递函数参数 void SomeMutatingOperation(FThing& OutResult, const TArray<Int3...
( LightShapeBlueprint->GeneratedClass ) );// UChildActorComponent* ChildActorComponent = CreateDefaultSubobject<UChildActorComponent>("Slot");// ChildActorComponent->SetChildActorClass(TSubclassOf<ASlot>());// ChildActorComponent->SetupAttachment(RootComponent);// const auto temp_childActor...
void AMyActor::EndPlay(const EEndPlayReason::Type EndPlayReason) 删除类型介绍 Destroyed 当actor或是component彻底被删除时(内存中删除) LevelTransition 关卡切换时删除回调(非关卡流) EndPlayInEditor 编辑器关闭时,回调通知 RemovedFromWorld 关卡流切换被释放时调用 ...
/** Templated version of SpawnActor that allows you to specify a class type via the template type*///(泛型编程)由于 C++ 是编译型语言,在编译前必须确定好类型,//定义一个还不确定具体类型的 T类型,调用时需使用尖括号来确定<具体类型>template<classT >T* SpawnActor(constFActorSpawnParameters& Spawn...
C =11, D }; UHT 生成的部分反射代码: 1 2 3 4 5 6 staticconstUE4CodeGen_Private::FEnumeratorParam Enumerators[] = { {"EClassEnum::A", (int64)EClassEnum::A }, {"EClassEnum::B", (int64)EClassEnum::B }, {"EClassEnum::C", (int64)EClassEnum::C }, ...
constuint8 chCRCLTable[]=// CRC 低位字节值表{0x00,0xC0,0xC1,0x01,0xC3,0x03,0x02,0xC2,0xC6,0x06,0x07,0xC7,0x05,0xC5,0xC4,0x04,0xCC,0x0C,0x0D,0xCD,0x0F,0xCF,0xCE,0x0E,0x0A,0xCA,0xCB,0x0B,0xC9,0x09,0x08,0xC8,0xD8,0x18,0x19,0xD9,0x1B,0xDB,0xDA,0x1A,0x...
void OnOverlapBegin(class AActor* OtherActor, class UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult); 复制代码 值的注意的是,實作的函數名是 XXXX_Implementation 在執行時會自動呼叫 void AMyActor::OnOverlapBegin_Implementation(class AActor* OtherActo...