Ejemplo n.º 1
0
    private void Awake()
    {
        _playerSpawn  = PlayerSpawn.Instance();
        _finish       = Finish.Instance();
        _camera       = Instantiate(_cameraGameObject, _finish.transform.position + CameraOffset, Quaternion.Euler(CameraRotation)).GetComponent <Camera>();
        _followPlayer = _camera.GetComponent <FollowPlayer>();
        KillZone.Instance().BindOnDieEvent(ShowRespawn);


        SpawnPlayer();

        _playerMovement = _playerPawn.GetComponent <PlayerMovement>();
        _respawnCamPos  = RespawnCameraLocation.Instance().transform.position;

        _camera.transform.DOMove(_playerSpawn.transform.position + CameraOffset, 4).SetDelay(2f).OnComplete(gameStart).Play();
    }