Example #1
0
 public PlayerService(IPathService _pathService, IGameService _gameService, IInteractable _interactableService, PlayerScriptableObject _playerScriptableObject, SignalBus _signalBus, ICamera camera) //
 {
     this.signalBus         = _signalBus;
     this.camera            = camera;
     gameService            = _gameService;
     interactableService    = _interactableService;
     currentPathService     = _pathService;
     playerScriptableObject = _playerScriptableObject;
     this.signalBus.Subscribe <PlayerDeathSignal>(this.PlayerDead);
     this.signalBus.Subscribe <ResetSignal>(this.ResetLevel);
     this.signalBus.Subscribe <GameStartSignal>(this.OnGameStart);
     this.signalBus.Subscribe <StateChangeSignal>(this.OnStateChange);
 }
Example #2
0
        public PlayerController(IPlayerService _playerService, IGameService _gameService, IPathService _pathService, IInteractable _interactableService, PlayerScriptableObject _playerScriptableObject, SignalBus signalBus)
        {
            this.signalBus      = signalBus;
            playerService       = _playerService;
            pathService         = _pathService;
            gameService         = _gameService;
            interactableService = _interactableService;

            scriptableObject = _playerScriptableObject;

            playerNodeID  = pathService.GetPlayerNodeID();
            spawnLocation = pathService.GetNodeLocation(playerNodeID);

            SpawnPlayerView();
            playerService.GetSignalBus().Subscribe <DisguiseSignal>(SetDisguiseType);
        }