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(); }
// Start is called before the first frame update void Start() { Finish.Instance().BindOnFinishedEvent(() => { gameObject.SetActive(true); }); gameObject.SetActive(false); }