QTE bugfix and UI improve
This commit is contained in:
parent
727921f1a4
commit
1ea3f9cbb4
BIN
UnrealProject/Lost_Edge/Content/Levels/Test/Actors/QuickTimeEventTest/BP_Test_QTESingle.uasset
(Stored with Git LFS)
BIN
UnrealProject/Lost_Edge/Content/Levels/Test/Actors/QuickTimeEventTest/BP_Test_QTESingle.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventMultiPress.uasset
(Stored with Git LFS)
BIN
UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventMultiPress.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventSinglePress.uasset
(Stored with Git LFS)
BIN
UnrealProject/Lost_Edge/Content/UI/Blueprints/QuickTimeEvents/UI_QuickTimeEventSinglePress.uasset
(Stored with Git LFS)
Binary file not shown.
@ -91,31 +91,29 @@ namespace SlowMotion
|
|||||||
|
|
||||||
void UCommonFunctions::EnterSlowMotion(float duration)
|
void UCommonFunctions::EnterSlowMotion(float duration)
|
||||||
{
|
{
|
||||||
if(SlowMotion::targetDilation == SlowMotion::slowDilation)
|
|
||||||
return;
|
|
||||||
|
|
||||||
SlowMotion::targetDilation = SlowMotion::slowDilation;
|
|
||||||
|
|
||||||
auto GI = UCustomGameInstance::Get();
|
auto GI = UCustomGameInstance::Get();
|
||||||
if(!GI)
|
if(!GI)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto world = GI->GetWorld();
|
auto world = GI->GetWorld();
|
||||||
|
if(FloatIsZero(UGameplayStatics::GetGlobalTimeDilation(world) - SlowMotion::slowDilation))
|
||||||
|
return;
|
||||||
|
|
||||||
|
SlowMotion::targetDilation = SlowMotion::slowDilation;
|
||||||
world->GetTimerManager().SetTimer(SlowMotion::timer, []() { SlowMotionTick(); }, 0.01f, true); // wrapped in lambda due to some template function class referencing
|
world->GetTimerManager().SetTimer(SlowMotion::timer, []() { SlowMotionTick(); }, 0.01f, true); // wrapped in lambda due to some template function class referencing
|
||||||
}
|
}
|
||||||
|
|
||||||
void UCommonFunctions::ExitSlowMotion(float duration)
|
void UCommonFunctions::ExitSlowMotion(float duration)
|
||||||
{
|
{
|
||||||
if(SlowMotion::targetDilation == SlowMotion::normalDilation)
|
|
||||||
return;
|
|
||||||
|
|
||||||
SlowMotion::targetDilation = SlowMotion::normalDilation;
|
|
||||||
|
|
||||||
auto GI = UCustomGameInstance::Get();
|
auto GI = UCustomGameInstance::Get();
|
||||||
if(!GI)
|
if(!GI)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto world = GI->GetWorld();
|
auto world = GI->GetWorld();
|
||||||
|
if(FloatIsZero(UGameplayStatics::GetGlobalTimeDilation(world) - SlowMotion::normalDilation))
|
||||||
|
return;
|
||||||
|
|
||||||
|
SlowMotion::targetDilation = SlowMotion::normalDilation;
|
||||||
world->GetTimerManager().SetTimer(SlowMotion::timer, []() { SlowMotionTick(); }, 0.01f, true);
|
world->GetTimerManager().SetTimer(SlowMotion::timer, []() { SlowMotionTick(); }, 0.01f, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user