直接贴代码
引擎源代码
AnimInstance.h
Delegates
////////////////// Montage Start
/**
* Delegate for when Montage is started
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMontageStartedMCDelegate, UAnimMontage*, Montage);
////////////////// Montage End
/**
* Delegate for when Montage is completed, whether interrupted or finished
* Weight of this montage is 0.f, so it stops contributing to output pose
*
* bInterrupted = true if it was not property finished
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnMontageEndedMCDelegate, UAnimMontage*, Montage, bool, bInterrupted);
////////////////// Blend In
/** Delegate for when Montage finished blending in */
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMontageBlendedInEndedMCDelegate, UAnimMontage*, Montage);
////////////////// Blend Out
/**
* Delegate for when Montage started to blend out, whether interrupted or finished
* DesiredWeight of this montage becomes 0.f, but this still contributes to the output pose
*
* bInterrupted = true if it was not property finished
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnMontageBlendingOutStartedMCDelegate, UAnimMontage*, Montage, bool, bInterrupted);
Delegate 声明
/** Called when a montage starts blending out, whether interrupted or finished */
UPROPERTY(BlueprintAssignable)
FOnMontageBlendingOutStartedMCDelegate OnMontageBlendingOut;
/** Called when a montage finishes blending in */
UPROPERTY(BlueprintAssignable)
FOnMontageBlendedInEndedMCDelegate OnMontageBlendedIn;
/** Called when a montage has started */
UPROPERTY(BlueprintAssignable)
FOnMontageStartedMCDelegate OnMontageStarted;
/** Called when a montage has ended, whether interrupted or finished*/
UPROPERTY(BlueprintAssignable)
FOnMontageEndedMCDelegate OnMontageEnded;
调用
GetCharacter()->PlayAnimMontage(UAnimMontage*);
GetCharacter()->GetAnimInstance()->{Delegate声明的内容}.AddDynamic(this, &类::绑定方法);
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容