Ejemplo n.º 1
0
    public void DrawMesh(int playerAmount)
    {
        if (meshManager.mesh.vertexCount > 0)
        {
            meshManager.AddIndicesAndDrawMesh(playerAmount);
        }

        meshManager.SetVertices(MeshManager.ConcatV2ListsToV3(innerPoints, outerPoints));
    }
Ejemplo n.º 2
0
    public void LerpToCircle()
    {
        LevelManager.innerPoints = lerpManager.LerpToCircle(LevelManager.innerLerpFrom, LevelManager.innerLerpTo, _inGameManager.lerpedAmount);
        LevelManager.outerPoints = lerpManager.LerpToCircle(LevelManager.outerLerpFrom, LevelManager.outerLerpTo, _inGameManager.lerpedAmount);

        playerManager.CircleUpdatePlayerPosition(_inGameManager.lerpedAmount);
        playerManager.PlayersLookAtPoint(_inGameManager.levelCenter);
        arqdutManager.CircleUpdateArqdutPosition(LevelManager.innerPoints, _inGameManager.levelCenter);

        meshManager.SetVertices(MeshManager.ConcatV2ListsToV3(LevelManager.innerPoints, LevelManager.outerPoints));

        _inGameManager.lerpedAmount += _inGameManager.shouldLerpFromCircle ? -_inGameManager.lerpAmount : _inGameManager.lerpAmount;
    }
Ejemplo n.º 3
0
    /// <summary>
    /// Calls all methods necessary for spawning the initial level
    /// </summary>
    public void SpawnLevel(int corners)
    {
        LevelManager.innerPoints = pointManager.SpawnInnerPoints(corners, _inGameManager.levelCenter);
        LevelManager.outerPoints = pointManager.SpawnOuterPoints(LevelManager.innerPoints);

        playerManager.SpawnPlayers(pointManager.radius, ChooseControls.playerStates.Where(o => o.Value != PlayerState.Deactivated).Select(i => i.Key).ToArray());

        playerManager.PlayersLookAtPoint(_inGameManager.levelCenter);
        meshManager.SetMaterials();
        arqdutManager.SpawnArqduts(LevelManager.innerPoints, _inGameManager.levelCenter);

        meshManager.SetVertices(MeshManager.ConcatV2ListsToV3(LevelManager.innerPoints, LevelManager.outerPoints));
        _inGameManager.DrawMesh(corners);

        if (ChooseControls.gameStarted)
        {
            _gameManager.StartCountdown(_inGameManager.levelCenter);
        }
    }
Ejemplo n.º 4
0
    private void FinishFromLerp()
    {
        _inGameManager.shouldLerpFromCircle = false;
        _inGameManager.lerpedAmount         = 0;

        LevelManager.innerPoints = pointManager.SpawnInnerPoints(3, _inGameManager.levelCenter); // Problem with rotation
        LevelManager.outerPoints = pointManager.SpawnOuterPoints(LevelManager.innerPoints);

        meshManager.mesh.Clear();
        meshManager.SetVertices(MeshManager.ConcatV2ListsToV3(LevelManager.innerPoints, LevelManager.outerPoints));
        meshManager.SetMaterials();
        meshManager.AddIndicesAndDrawMesh(3);

        _circleSpawnedPlayerColor = _inGameManager.circleSpawningPlayer.Color;

        PlayerColor[] activatedColor = PlayerManager.players.Select(p => p.Color).OrderBy(i => (int)i).ToArray();

        playerManager.DestroyAllPlayers();
        playerManager.SpawnPlayers(pointManager.radius, activatedColor);
        playerManager.PlayersLookAtPoint(_inGameManager.levelCenter);

        arrowManager.AttachLeftArrow(PlayerManager.players.First(p => p.Color == _circleSpawnedPlayerColor));
    }