Ejemplo n.º 1
0
    public void SetPlayerType(PlayerType playerType)
    {
        gameObject.SetActive(true);

        switch (playerType)
        {
        case PlayerType.Catcher:
        {
            transform.localScale       *= GameParameters.CATCHER_SIZE;
            maxSpeed                    = GameParameters.CATCHER_MAX_SPEED;
            _catcherParticleSystem.loop = true;
            _catcherParticleSystem.Play();
            _trailRenderer.enabled = true;
            gameObject.layer       = GameParameters.CATCHER_LAYER;
            _frozen.Init(false);
            break;
        }

        case PlayerType.Runner:
        {
            transform.localScale *= GameParameters.RUNNER_SIZE;
            maxSpeed              = GameParameters.RUNNER_MAX_SPEED;
            gameObject.layer      = GameParameters.RUNNER_LAYER;
            _frozen.Init(true);
            break;
        }

        default:
            break;
        }

        _characterAnimation.SetSpriteRenderer(_characterUI.GetSprite());
        _playerType    = playerType;
        gameObject.tag = _playerType.ToString();
    }