Last active
June 30, 2019 10:45
-
-
Save olegknyazev/ebac249f58f53f41fa39c31d59937cb2 to your computer and use it in GitHub Desktop.
An example of bottom-up naming in Turret
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ATurret::Tick(float DeltaSeconds) { | |
... | |
TimeSinceLastTargetUpdate += DeltaSeconds; | |
if (TimeSinceLastTargetUpdate >= TargetSearchInterval) { | |
TimeSinceLastTargetUpdate = 0.f; | |
CurrentTarget = FindNearestTarget(); | |
} | |
} | |
AActor* ATurret::FindNearestTarget() { | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment