<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
<aside> 💡 Every run ends on a result page. UIRunResult is shown after a normal run. UILevelComplete is shown after the finish wall. Both count up the reward and offer a rewarded double.
</aside>
PlayerController.OnRunFinished fires.GameController calculates the reward and reports the distance to the Record Wall.UIGame hides and UIRunResult shows.AdsManager allows it) and passes the final reward to GameController.PlayerController.OnFinishReached fires.GameController marks the level as completed, calculates the reward, freezes the camera, hides the HUD and plays the confetti and the level complete sound.UILevelComplete shows the distance, the time, the top speed, the coins and the reward.After the finish wall, the restart is not available. The run ends only by the level complete flow.
reward = round(distance * Money Per Distance * Income Multiplier) + coins collected in the run
| Part | Source |
|---|---|
| Distance | PlayerController.DistanceTraveled along the launch direction. |
| Money Per Distance | Game Data. |
| Income Multiplier | ProgressionController.IncomeMultiplier: the IncomeMultiplier upgrade plus the pre-run modifier bonus. |
| Coins collected | RunCoinsController.Amount. See ‣. |
The x2 button is visible only when a rewarded video is loaded and the reward is not doubled yet. After the ad completes, the reward is multiplied by two and the counter animates to the new value.
AdsManager.ShowRewardBasedVideo(OnDoubleAdCompleted);
The restart button of UIGame ends the run without the result page. Coins of the run are dropped. When the run had already ended and the reward was calculated, the reward is added directly.
The pages do not change the balance. Continue hands the final reward to GameController, which adds it to the balance through the start screen coin cloud. A run closed in the middle loses the uncredited coins.
GameController selects the first level when there is no next level. All levels stay unlocked on the progression page.
TMP_Text field to UILevelComplete and assign it in the prefab.SetResult.GameController.ShowLevelComplete.