Skip to content

Commit 440a2b1

Browse files
author
Damian Nowakowski
committed
tabs to spaces for source code and fix in readme
1 parent b9f03e5 commit 440a2b1

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ CoroHandle CoroFadeOut()
403403
{
404404
CameraManager->SetManualCameraFade((float)Fade * .01f, FColor::Black, false);
405405
}
406-
co_await CoroWaitSeconds(.1f);
406+
co_await WaitSecondsTask(.1f);
407407
}
408408
}
409409
}
@@ -418,7 +418,7 @@ The coroutine Handle is obtained from the `await_suspend` function.
418418
The `await_suspend` function starts the Unreal Engine ticker which will resume the suspended coroutine using the received coroutine Handle.
419419

420420
## Fade Out function
421-
The fade out function changes the camera fade in a for loop in 10 steps every 0.1 second. You can notice the `co_await CoroWaitSeconds(.1f)` after every loop iteration, which triggers our waiting coroutine Task.
421+
The fade out function changes the camera fade in a for loop in 10 steps every 0.1 second. You can notice the `co_await WaitSecondsTask(.1f)` after every loop iteration, which triggers our waiting coroutine Task.
422422

423423
In order to use this function, simply call it in your project.
424424

Samples/04_CoroUE5FadeOut.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ CoroHandle CoroFadeOut()
8888
// Warning, there will be velociraptors: World should be obtained by a World Context Object,
8989
// but just for the example sake we use nasty GWorld.
9090
if (GWorld)
91-
{
92-
APlayerCameraManager* CameraManager = UGameplayStatics::GetPlayerCameraManager(GWorld, 0);
93-
for (int32 Fade = 0; Fade <= 100; Fade += 10)
94-
{
91+
{
92+
APlayerCameraManager* CameraManager = UGameplayStatics::GetPlayerCameraManager(GWorld, 0);
93+
for (int32 Fade = 0; Fade <= 100; Fade += 10)
94+
{
9595
// Because the WaitSecondsTask can tick between worlds we can't be sure if the Camera Manager
9696
// is valid all the time.
97-
if (IsValid(CameraManager))
98-
{
99-
CameraManager->SetManualCameraFade((float)Fade * .01f, FColor::Black, false);
100-
}
101-
co_await CoroWaitSeconds(.1f);
102-
}
103-
}
104-
}
97+
if (IsValid(CameraManager))
98+
{
99+
CameraManager->SetManualCameraFade((float)Fade * .01f, FColor::Black, false);
100+
}
101+
co_await WaitSecondsTask(.1f);
102+
}
103+
}
104+
}

0 commit comments

Comments
 (0)