コード例 #1
0
        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();
            }
        }
コード例 #2
0
 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();
 }
コード例 #3
0
 public SelectScreenPlayerController(int deviceIndex, UIInputManager playerUIInputManager, CharacterSelectScreen characterSelectScreen)
 {
     this.deviceIndex           = deviceIndex;
     this.characterSelectScreen = characterSelectScreen;
     this.playerUIInputManager  = playerUIInputManager;
     this.playerActive          = false;
     //Subscribe();
 }
コード例 #4
0
 // Start is called before the first frame update
 private void Initialize()
 {
     if (!initialized)
     {
         uiInput     = InputManager.Instance.generalUIInputManager;
         initialized = true;
         Subscribe();
     }
 }
コード例 #5
0
        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);
        }
コード例 #6
0
 private void OnDeviceRegistered(UserDevice userDevice, PlayerGameplayInputManager gameplayInputManager, UIInputManager uiInputManager)
 {
     TryToAssignDefaultDevice(userDevice);
 }