Payback 0.0.1
CK Graduation Project
로딩중...
검색중...
일치하는것 없음
UAnimNotifyState_OverlayMaterial 클래스 참조

#include <AnimNotifyState_OverlayMaterial.h>

UAnimNotifyState_OverlayMaterial에 대한 상속 다이어그램 :
Inheritance graph
UAnimNotifyState_OverlayMaterial에 대한 협력 다이어그램:
Collaboration graph

Public 멤버 함수

virtual void NotifyBegin (USkeletalMeshComponent *MeshComp, UAnimSequenceBase *Animation, float TotalDuration, const FAnimNotifyEventReference &EventReference) override
 
virtual void NotifyTick (USkeletalMeshComponent *MeshComp, UAnimSequenceBase *Animation, float FrameDeltaTime, const FAnimNotifyEventReference &EventReference) override
 
virtual void NotifyEnd (USkeletalMeshComponent *MeshComp, UAnimSequenceBase *Animation, const FAnimNotifyEventReference &EventReference) override
 

Protected 속성

TObjectPtr< UMaterialInterface > OverlayMaterial = nullptr
 
FName IntensityParameterName = TEXT("OutlineIntensity")
 
float TargetIntensity = 500.0f
 
float FadeInDuration = 0.15f
 
float FadeOutDuration = 0.15f
 

멤버 함수 문서화

◆ NotifyBegin()

void UAnimNotifyState_OverlayMaterial::NotifyBegin ( USkeletalMeshComponent *  MeshComp,
UAnimSequenceBase *  Animation,
float  TotalDuration,
const FAnimNotifyEventReference &  EventReference 
)
overridevirtual
10{
11 Super::NotifyBegin(MeshComp, Animation, TotalDuration, EventReference);
12
13 if (IsValid(MeshComp) == false || IsValid(OverlayMaterial) == false)
14 {
15 return;
16 }
17
18 UMaterialInstanceDynamic* DynamicMaterial = UMaterialInstanceDynamic::Create(OverlayMaterial, MeshComp);
19
20 // 할당 전에 밝기를 설정해 첫 프레임부터 최대 밝기로 보이는 것을 방지한다.
21 DynamicMaterial->SetScalarParameterValue(IntensityParameterName, 0.0f);
22 MeshComp->SetOverlayMaterial(DynamicMaterial);
23}
FName IntensityParameterName
Definition AnimNotifyState_OverlayMaterial.h:25
TObjectPtr< UMaterialInterface > OverlayMaterial
Definition AnimNotifyState_OverlayMaterial.h:22

다음을 참조함 : IntensityParameterName, OverlayMaterial.

◆ NotifyEnd()

void UAnimNotifyState_OverlayMaterial::NotifyEnd ( USkeletalMeshComponent *  MeshComp,
UAnimSequenceBase *  Animation,
const FAnimNotifyEventReference &  EventReference 
)
overridevirtual
59{
60 Super::NotifyEnd(MeshComp, Animation, EventReference);
61
62 if (IsValid(MeshComp) == false)
63 {
64 return;
65 }
66
67 MeshComp->SetOverlayMaterial(nullptr);
68}

◆ NotifyTick()

void UAnimNotifyState_OverlayMaterial::NotifyTick ( USkeletalMeshComponent *  MeshComp,
UAnimSequenceBase *  Animation,
float  FrameDeltaTime,
const FAnimNotifyEventReference &  EventReference 
)
overridevirtual
26{
27 Super::NotifyTick(MeshComp, Animation, FrameDeltaTime, EventReference);
28
29 const FAnimNotifyEvent* NotifyEvent = EventReference.GetNotify();
30 if (IsValid(MeshComp) == false || NotifyEvent == nullptr)
31 {
32 return;
33 }
34
35 UMaterialInstanceDynamic* GetOverlayMaterial = Cast<UMaterialInstanceDynamic>(MeshComp->GetOverlayMaterial());
36 if (IsValid(GetOverlayMaterial) == false)
37 {
38 return;
39 }
40
41 // NotifyState가 시작된 뒤 경과한 애니메이션 시간
42 const float ElapsedTime = UAnimNotifyLibrary::GetCurrentAnimationNotifyStateTime(EventReference);
43
44 // NotifyState가 끝날 때까지 남은 애니메이션 시간
45 const float RemainingTime = NotifyEvent->GetDuration() - ElapsedTime;
46
47 const float FadeInAlpha = FadeInDuration < KINDA_SMALL_NUMBER
48 ? 1.0f : FMath::Clamp(ElapsedTime / FadeInDuration, 0.0f, 1.0f);
49 const float FadeOutAlpha = FadeOutDuration < KINDA_SMALL_NUMBER
50 ? 1.0f : FMath::Clamp(RemainingTime / FadeOutDuration, 0.0f, 1.0f);
51
52 // SmoothStep으로 페이드 시작과 끝의 밝기 변화를 완만하게
53 const float FadeAlpha = FMath::SmoothStep(0.0f, 1.0f, FMath::Min(FadeInAlpha, FadeOutAlpha));
54 const float Intensity = TargetIntensity * FadeAlpha;
55 GetOverlayMaterial->SetScalarParameterValue(IntensityParameterName, Intensity);
56}
float TargetIntensity
Definition AnimNotifyState_OverlayMaterial.h:28
float FadeOutDuration
Definition AnimNotifyState_OverlayMaterial.h:34
float FadeInDuration
Definition AnimNotifyState_OverlayMaterial.h:31

다음을 참조함 : FadeInDuration, FadeOutDuration, IntensityParameterName, TargetIntensity.

멤버 데이터 문서화

◆ FadeInDuration

float UAnimNotifyState_OverlayMaterial::FadeInDuration = 0.15f
protected

다음에 의해서 참조됨 : NotifyTick().

◆ FadeOutDuration

float UAnimNotifyState_OverlayMaterial::FadeOutDuration = 0.15f
protected

다음에 의해서 참조됨 : NotifyTick().

◆ IntensityParameterName

FName UAnimNotifyState_OverlayMaterial::IntensityParameterName = TEXT("OutlineIntensity")
protected

다음에 의해서 참조됨 : NotifyBegin(), NotifyTick().

◆ OverlayMaterial

TObjectPtr<UMaterialInterface> UAnimNotifyState_OverlayMaterial::OverlayMaterial = nullptr
protected

다음에 의해서 참조됨 : NotifyBegin().

◆ TargetIntensity

float UAnimNotifyState_OverlayMaterial::TargetIntensity = 500.0f
protected

다음에 의해서 참조됨 : NotifyTick().


이 클래스에 대한 문서화 페이지는 다음의 파일들로부터 생성되었습니다.: