コード例 #1
0
    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();
    }
コード例 #2
0
    private void OnEnable()
    {
        inputReader.CameraMoveEvent += OnCameraMove;
        inputReader.EnableMouseControlCameraEvent  += OnEnableMouseControlCamera;
        inputReader.DisableMouseControlCameraEvent += OnDisableMouseControlCamera;

        _protagonistTransformAnchor.OnAnchorProvided += SetupProtagonistVirtualCamera;
        _camShakeEvent.OnEventRaised += impulseSource.GenerateImpulse;

        _cameraTransformAnchor.Provide(mainCamera.transform);
    }