private void Initialize() { if (!Initialized) { Initialized = true; var uiInput = new UIInput(); uiInput.Enable(); generalUIInputManager = new UIInputManager(uiInput); InputUser.listenForUnpairedDeviceActivity++; userDevices = new List <UserDevice>(); gameplayInputManagers = new List <PlayerGameplayInputManager>(); playerUIInputManagers = new List <UIInputManager>(); activePlayers = new List <PlayerSessionData>(); if (Keyboard.current != null) { for (int i = 0; i < keyboardSchemeNames.Count; i++) { InitializeUnusedDevice(Keyboard.current, keyboardSchemeNames[i]); } } Subscribe(); OnInputInitialized?.Invoke(); } }
public PlayerSessionData(int playerIndex, int deviceIndex, PlayerGameplayInputManager charInputManager, UIInputManager uiInputManager) { this.playerIndex = playerIndex; this.deviceIndex = deviceIndex; this.gameplayInputManager = charInputManager; this.uiInputManager = uiInputManager; //playerData = new PlayerData(); }
public SelectScreenPlayerController(int deviceIndex, UIInputManager playerUIInputManager, CharacterSelectScreen characterSelectScreen) { this.deviceIndex = deviceIndex; this.characterSelectScreen = characterSelectScreen; this.playerUIInputManager = playerUIInputManager; this.playerActive = false; //Subscribe(); }
// Start is called before the first frame update private void Initialize() { if (!initialized) { uiInput = InputManager.Instance.generalUIInputManager; initialized = true; Subscribe(); } }
private void InitializeUnusedDevice(InputDevice device, string schemeName) { int deviceIndex = userDevices.Count; UserDevice userDevice = new UserDevice(deviceIndex, device, schemeName); userDevices.Add(userDevice); PlayerGameplayInputManager gameplayInputManager = new PlayerGameplayInputManager(userDevice.gameplayInput); gameplayInputManagers.Add(gameplayInputManager); UIInputManager uiInputManager = new UIInputManager(userDevice.uiInput); playerUIInputManagers.Add(uiInputManager); //uDevice.EnableUIInput(true); //This should be elsewhere or conditional /*SelectScreenPlayerController playerSelectController = new SelectScreenPlayerController(deviceIndex, uiInputManager, this); * playerSelectControllers.Add(playerSelectController);*/ OnDeviceRegistered?.Invoke(userDevice, gameplayInputManager, uiInputManager); }
private void OnDeviceRegistered(UserDevice userDevice, PlayerGameplayInputManager gameplayInputManager, UIInputManager uiInputManager) { TryToAssignDefaultDevice(userDevice); }