_,__LINE__,_DELEGATE) FUNC_DECLARE_DYNAMIC_DELEGATE( FWeakObjectPtr, DelegateName, DelegateName##_DelegateWrapper, FUNC_CONCAT( Param1Type InParam1 ), FUNC_CONCAT( *this, InParam1 ), void, Param1Type )#define BODY_MACRO_COMBINE_INNER(A,B,C,D) A##B...
DECLARE_DELEGATE_RetVal_OneParam( ReturnValueType, DelegateName, Param1Type ) DECLARE_DYNAMIC_DELEGATE_RetVal_OneParam( ReturnValueType, DelegateName, Param1Type, Param1Name ) 例如: DECLARE_DELEGATE_RetVal_OneParam(bool, FIsMontagePlayingExceptSlots, const TArray<FName>&); 补充点: 多播委托与单播委...
DECLARE_DELEGATE//普通代理DECLARE_DYNAMIC_DELEGATE_TwoParams//动态代理DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams//动态多广播代理//多出的两个关键字的作用In thecaseof multicast delegates, any number of entities within your codebasecan respond to the sameeventand receive the inputs and use them. In...
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FLoadDesignsDelegateEvent, const TArray<FDesignInfo>&, _designsInfo, const bool, _result); //声明代理事件类型 static FLoadDesignsDelegateEvent m_OnLoadDesignsEve; //调用代理事件 UFUNCTION(BlueprintCallable, Category = "BZone|SaveGameSystem") static void ...
//动态委托DECLARE_DYNAMIC_DELEGATE(FWDE_Dy_Sl_Zero);//委托变量作为参数UFUNCTION(BlueprintCallable, Category ="FrameWork")voidRegFunDel(FWDE_Dy_Sl_Zero TargetFun); 动态多播委托 AddDynamic绑定的方法得被UFUNCTION标记,否则绑定无效 动态代理对象类型可以使用UPROPERTY标记,并设置为BlueprintAssignable,从而暴露...
DECLARE_DELEGATE//普通代理DECLARE_DYNAMIC_DELEGATE_TwoParams//动态代理DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams//动态多广播代理//多出的两个关键字的作用In thecaseof multicast delegates, any number of entities within your codebasecan respond to the sameeventand receive the inputs and use them. ...
动态单播代理的实现基于宏DECLARE_DYNAMIC_DELEGATE_OneParam。宏接收三个参数:代理名、参数类型和参数名。宏使用BODY_MACRO_COMBINE辅助宏,将参数拼接为独一无二的名字,进而实现代理类的封装。执行代理方法通常涉及宏FUNC_DECLARE_DYNAMIC_DELEGATE,该宏接收多个参数,如弱指针类型、代理名、执行函数接口、...
DECLARE_DELEGATE_OneParamDECLARE_DELEGATE_OneParam(FSingleDelegateWithOneParam,FString);//创建一个参数单播委托对象FSingleDelegateWithOneParam SDOneParam;//定义多个参数的单播委托,注意!!当参数数量大于1时是Params!!! DECLARE_DELEGATE_TwoParamsDECLARE_DELEGATE_TwoParams(FSingleDelegateWithTwoParams,FString,int...
// 动态委托需要同时写出函数参数类型名称和参数变量名称,且自定义委托名称以‘F’开头DECLARE_DYNAMIC_DELEGATE_OneParam(FDelegateName,int,num);// 动态委托可以使用宏标记暴露给蓝图,但动态单播不能在蓝图定义委托实例和绑定委托函数UPROPERTY(BlueprintReadWrite)FDelegateName DelegateInst;// 类似静态单播的绑定,但...
#define DECLARE_MULTICAST_DELEGATE( DelegateName ) FUNC_DECLARE_MULTICAST_DELEGATE( DelegateName, void ) #define DECLARE_EVENT( OwningType, EventName ) FUNC_DECLARE_EVENT( OwningType, EventName, void ) #define DECLARE_DYNAMIC_DELEGATE( DelegateName ) BODY_MACRO_COMBINE(CURRENT_FILE_ID,_,__LINE...