private void SpawnPlayer() { Transform spawnLocation = GetSpawnLocation(); Protagonist playerInstance = Instantiate(_playerPrefab, spawnLocation.position, spawnLocation.rotation); _playerInstantiatedChannel.RaiseEvent(playerInstance.transform); _playerTransformAnchor.Provide(playerInstance.transform); //the CameraSystem will pick this up to frame the player //TODO: Probably move this to the GameManager once it's up and running _inputReader.EnableGameplayInput(); }
private void OnEnable() { inputReader.CameraMoveEvent += OnCameraMove; inputReader.EnableMouseControlCameraEvent += OnEnableMouseControlCamera; inputReader.DisableMouseControlCameraEvent += OnDisableMouseControlCamera; _protagonistTransformAnchor.OnAnchorProvided += SetupProtagonistVirtualCamera; _camShakeEvent.OnEventRaised += impulseSource.GenerateImpulse; _cameraTransformAnchor.Provide(mainCamera.transform); }