private void EndActivePlayerTurn(PlayerBehaviour player)
        {
            CameraBehaviour.SetTarget(player.transform.position);

            foreach (var obj in this._players.Where(x => x.Id != player.Id))
            {
                obj.SetMovementAllowance(false);
            }

            CameraLock();
            player.AllowMovement = true;

            DisplayMessage("Your turn is ending in 3 seconds.", 2);
            SetRoundTime(4);
            SetTimerCoroutine(4, () =>
            {
                if (player.State == PlayerState.IsEndingTurn)
                {
                    player.ChangeState(PlayerState.IsDone);
                }
            });
        }
        public void ChangePlayerState(PlayerState state, PlayerBehaviour player, bool internalStateChange = false)
        {
            this._actionToRun = null;


            if (!internalStateChange)
            {
                if (this._timingCoroutine != null)
                {
                    StopCoroutine(this._timingCoroutine);
                }
            }

            switch (state)
            {
            case PlayerState.IsActive:
                if (!internalStateChange)
                {
                    SetTimerCoroutine(Global.CurrentRoundTime, () =>
                    {
                        if (player.State == PlayerState.IsActive || player.State == PlayerState.IsUsingUtility)
                        {
                            player.ChangeState(PlayerState.IsDone);
                        }
                    });
                }
                break;

            case PlayerState.IsUsingUtility:
                if (player.HasUsedUtility)
                {
                    DisplayMessage("You have already used a utility in this round.", 2);
                }
                player.ChangeState(PlayerState.IsActive, true, true);
                break;

            case PlayerState.IsFiring:
                CameraBehaviour.Locked = true;
                UiController.TimerController.Freeze = true;

                foreach (var obj in this._players.Where(x => x.Id != player.Id))
                {
                    obj.SetMovementAllowance(true);
                }

                this._actionToRun = () =>
                {
                    if (Global.TrackWeaponPosition)
                    {
                        CameraBehaviour.SetTarget(Global.NextProjectileCollision);
                    }
                    else if (Global.TrackProjectilePosition && player.WeaponController.ProjectileToTrack != null)
                    {
                        CameraBehaviour.SetTarget(player.WeaponController.ProjectileToTrack.transform.position);
                    }
                };
                break;

            case PlayerState.IsFiringWithTrigger:
                UiController.TimerController.Freeze = true;

                foreach (var obj in this._players.Where(x => x.Id != player.Id))
                {
                    obj.SetMovementAllowance(true);
                }
                break;

            case PlayerState.IsEndingTurn:
                InitiatePlayerHits(player);
                break;

            case PlayerState.HasTriggeredHealthLoss:
                this._playersToTrigger.Remove(player);
                player.PlayerBeenHit = false;

                if (player.Id != _currentActivePlayer.Id)
                {
                    player.ChangeState(PlayerState.Idle);
                }

                if (this._playersToTrigger.Count > 0)
                {
                    this._playersToTrigger.First().ChangeState(PlayerState.HasLostHealth);
                }
                else
                {
                    if (player.Id == _currentActivePlayer.Id)
                    {
                        player.ChangeState(PlayerState.IsDone);
                        break;
                    }

                    EndActivePlayerTurn(_currentActivePlayer);
                }
                break;

            case PlayerState.IsDone:
                NextRound();
                break;

            case PlayerState.IsDead:
                DisplayMessage(player.Name + " has been killed.", 2);

                if (_players.Count(x => x.State == PlayerState.IsDead) >= (this._players.Count) - 1)
                {
                    NextRound();
                    Global.IsGameOver = true;
                    break;
                }

                if (this._playersToTrigger.Contains(player))
                {
                    this._playersToTrigger.Remove(player);
                    player.PlayerBeenHit = false;
                    player.SetMovementAllowance(false);

                    if (this._playersToTrigger.Count > 0)
                    {
                        this._playersToTrigger.First().ChangeState(PlayerState.HasLostHealth);
                    }
                    else
                    {
                        if (player.Id == _currentActivePlayer.Id)
                        {
                            NextRound();
                            break;
                        }

                        EndActivePlayerTurn(_currentActivePlayer);
                    }
                }

                if (player.Id == this._currentActivePlayer.Id)
                {
                    player.PlayerBeenHit = false;
                    player.SetMovementAllowance(false);
                    NextRound();
                }
                break;
            }
        }