Skip to content
Snippets Groups Projects
Verified Commit 03e22ae5 authored by Adrian Paschkowski's avatar Adrian Paschkowski :thinking:
Browse files

Disable round stop button during end animation

parent 10fe60b6
No related branches found
No related tags found
No related merge requests found
......@@ -23,10 +23,11 @@ public class RoundController : MonoBehaviour, IFighterCallback
BaseCameraController cameraController;
int aliveEnemiesCount = 0;
float targetRoundGameSpeed = 1f;
bool inRoundEndAnimation = false;
public void StartRound()
{
if (roundRunning)
if (roundRunning || inRoundEndAnimation)
{
return;
}
......@@ -46,7 +47,7 @@ public class RoundController : MonoBehaviour, IFighterCallback
public void StopRound()
{
if (!roundRunning)
if (!roundRunning || inRoundEndAnimation)
{
return;
}
......@@ -102,6 +103,7 @@ public class RoundController : MonoBehaviour, IFighterCallback
if (isAntiPlayer || aliveEnemiesCount == 0)
{
// Slowmo-zoom to last dying Figher
inRoundEndAnimation = true;
var targetGameSpeed = 0.2f;
SetCurrentGameSpeed(targetGameSpeed);
cameraController.AnimateToPosition(fighter.transform.position + new Vector3(0f, 0.75f), 1.5f, 0.125f * targetGameSpeed);
......@@ -111,6 +113,7 @@ public class RoundController : MonoBehaviour, IFighterCallback
void StopRoundAfterDeath()
{
inRoundEndAnimation = false;
StopRound();
cameraController.AnimateToPosition(new Vector3(0, 0, 0), 5f, 0.15f);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment