X Tutup
Skip to content

Added input action asset validation message to PlayerInputManager and editor#1297

Merged
andrew-oc merged 7 commits intodevelopfrom
fix-1265853-player-prefab-not-instantiated
Apr 27, 2021
Merged

Added input action asset validation message to PlayerInputManager and editor#1297
andrew-oc merged 7 commits intodevelopfrom
fix-1265853-player-prefab-not-instantiated

Conversation

@andrew-oc
Copy link
Contributor

Fixes 1265853 (Fogbugz)

Bug

This was not really a bug. When an input action asset with no required devices on any control scheme is used with PlayerInputManager and Join Players When Button Is Pressed join behavior, the expected outcome of the player joining the game when a button is pressed does not happen. This makes sense, since no input will match against a control scheme with no required devices, but is confusing to the user.

Fix

Added warning messages to PlayerInputManager editor and debug log to indicate that the attached input action asset has no required devices on any control scheme.

@andrew-oc andrew-oc requested a review from Rene-Damm March 23, 2021 09:02
Copy link
Contributor

@Rene-Damm Rene-Damm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor stuff.

return false;
}

private void ValidateInputActionAsset()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering, should this be debug build only?

Debug.LogWarning("The input action asset in the player prefab assigned to PlayerInputManager has " +
"no control schemes with required devices. The JoinPlayersWhenButtonIsPressed join behavior " +
"will not work unless the expected input devices are listed as requirements in the input " +
"action asset.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes it hard to track down the source. Probably good to mention asset name (or even path?). Also should give player prefab to LogWarning call as Unity object argument so that when clicking on the message in the console, the user can jump to the prefab.


if (playerInput.actions == null)
{
EditorGUILayout.HelpBox("PlayerInput component has no input action asset assigned", MessageType.Info);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing period.


if (playerInput == null)
{
EditorGUILayout.HelpBox("No PlayerInput component found in player prefab", MessageType.Info);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing period.

@andrew-oc andrew-oc requested a review from Rene-Damm April 6, 2021 13:32
@andrew-oc andrew-oc force-pushed the fix-1265853-player-prefab-not-instantiated branch from acba3c4 to 2340955 Compare April 19, 2021 14:10
@andrew-oc andrew-oc merged commit f030874 into develop Apr 27, 2021
@andrew-oc andrew-oc deleted the fix-1265853-player-prefab-not-instantiated branch April 27, 2021 09:29
js-dignitas added a commit to js-dignitas/InputSystem that referenced this pull request Jul 5, 2021
* commit '66551c18515d80400bcafb2817824f5272ecebb9': (126 commits)
  RELEASE: 1.1-pre.4.
  DOCS: Update LICENSE and CONTRIBUTIONS.
  CHANGE: Add event processing limits (Unity-Technologies#1325)
  FIX: clickCount not incremented correctly (case 1317239, Unity-Technologies#1315).
  FIX: Fixing Keyboard.current becoming null after OnScreenButton is disabled/destroyed (Unity-Technologies#1310)
  NEW: Adding UNITY_INCLUDE_TESTS define constraint to package test assemblies (Unity-Technologies#1294)
  FIX: Correctly selecting dropdown items when going up through hierarchy (Unity-Technologies#1309)
  CHANGE: InputSystemUIInputModule defaults are set via Reset instead of default script references (fixes 1323566) (Unity-Technologies#1317)
  FIX: Events queued during OnUpdate being lost (case 1297339). (Unity-Technologies#1321)
  NEW: Device Simulator plugin for Input System (Unity-Technologies#1264)
  Pin windows CI image to an exact version for now (Unity-Technologies#1323)
  Added input action asset validation message to PlayerInputManager and editor (Unity-Technologies#1297)
  FIX: Fixing compilation of tests on 2021.1 and short-term remediating docfx issues (Unity-Technologies#1322)
  FIX: Action reference destroyed in player prefab (case 1319756, Unity-Technologies#1316).
  Fixing control scheme creation issue (Unity-Technologies#1311)
  Fixing scheme name label being clipped (Unity-Technologies#1312)
  FIX: UI stops working when multiple scenes with event systems are additively loaded and unloaded (Unity-Technologies#1314)
  NEW: API to parse control paths (Unity-Technologies#1298).
  FIX: No OnPointerExit events without moving pointer (case 1232705, Unity-Technologies#1299).
  FIX: IndexOutOfRangeExceptions and null elements in InputUser.lostDevices (case 1275148, Unity-Technologies#1274).
  ...
bryandube added a commit that referenced this pull request Jul 19, 2021
* Switch default controller for unmatched layouts to XRControllerWithRumble and support '_' in sanitized strings

* reverted rumble change

* reverted changelog message since change was reverted

* FIX: Action reference destroyed in player prefab (case 1319756, #1316).

* FIX: Fixing compilation of tests on 2021.1 and short-term remediating docfx issues (#1322)

* Added input action asset validation message to PlayerInputManager and editor (#1297)

* Fix for tests

* Pin windows CI image to an exact version for now (#1323)

Authored-by: Dmytro Ivanov <dmytro@unity3d.com>

* NEW: Device Simulator plugin for Input System (#1264)

* FIX: Events queued during OnUpdate being lost (case 1297339). (#1321)

Co-authored-by: Rene Damm <rene@unity3d.com>

* CHANGE: InputSystemUIInputModule defaults are set via Reset instead of default script references (fixes 1323566) (#1317)

* FIX: Correctly selecting dropdown items when going up through hierarchy (#1309)

* NEW: Adding UNITY_INCLUDE_TESTS define constraint to package test assemblies (#1294)

* FIX: Fixing Keyboard.current becoming null after OnScreenButton is disabled/destroyed (#1310)

* FIX: clickCount not incremented correctly (case 1317239, #1315).

* CHANGE: Add event processing limits (#1325)

* DOCS: Update LICENSE and CONTRIBUTIONS.

* RELEASE: 1.1-pre.4.

* FIX: Package validation failure.

* FIX: Tests failing from change to -pre.

* FIX: InputUser.pairedDevices getting corrupted (case 1327628, #1326).

* FIX: Misaligned binding paths when in text mode (case 1200107, #1328).

* FIX: Calling InputSystem.Update from inside action callback causes stack overflow (case 1316000) (#1327)

* Added InputSystem.runUpdatesInEditMode for XR support (#1319)

* Fixing CI (#1357)

* FIX: InputTestFixture leaving .current at null (case 1329015, #1345).

* FIX: GetBindingDisplyString() doubling up output for composite bindings (case 1321175, #1330).

* FIX: Console errors for PlayerInput with empty action maps (case 1317735, #1341).

* FIX: Broken script references in Touch Samples (case 1190598, #1339).

* FIX: PointerInput in TouchSamples registered too late (case 1215048, #1342).

* FIX: MultiTapInteraction not respecting multiTapDelayTime setting (case 1292754, #1337).

* MERGE: stable => develop (#1343).

* FIX: Looking for wrong control types when rebinding parts of composites (case 1272563, #1338).

* FIX: No RMB menu when clicking empty tree views (case 1336426, #1351).

* FIX: EnumerateChangedControls skipping PS4 dpad left/right/down (case 1315107, #1336).

* FIX: AxisComposite not respecting min/maxValue (case 1335838, #1331).

* FIX: Undo not working in input settings (case 1291709, #1332).

* FIX: Remove error message when PlayerInput can't find action (case 1259577, #1334).

* CHANGE: InputDevice.OnConfigurationChanged now virtual (#1329).

* FIX: ArgumentOutOfRangeException in IsPointerOverGameObject (case 1337354, #1356).

* FIX: Stuck HoldInteraction when held&released in same event (case 1346786, #1361).

* FIX: Incorrect array indexing in InputUser. (#1362)

* FIX: Incorrect indexing in InputUser.OnDeviceChanged that could result in incorrect pairing of devices.

* FIX: Incorrect indexing when sorting in InputActionRebindingExtensions.RebindingOperation (#1364)

* FIX: Incorrect indexing when sorting magnitude based on score in InputActionRebindingExtensions.RebindingOperation.

* FIX: 'Add Action' not resetting interactions and processors (#1369).

* CHANGE: Touch OnPointerExit now deferred one frame (case 1347048, #1365).

* FIX: Setting motor speeds and light bar color in quick succession on DualShock 4 (#1346)

* FIX: Setting motor speeds and light bar color in quick succession on DualShock 4

This commit fixes the issue with calling SetMotorSpeeds followed by SetLightBarColor in quick succession on a DualShock 4 controller. The IOCTL interface currently only allows a single command at a time to be processed on the input device, so the second of these calls will usually fail. The fix contained here is simply to expose an extra method on the DualShock 4 interface called SetMotorSpeedsAndLightBarColor that combines both instructions into a single IOCTL command, but a more robust fix will be added later that deals with this issue universally at a lower level in the InputDevice hierarchy.

* Add documentation and tweaked changelog

* FIX: Callback ordering issues when adding/removing during execution (case 1322530, #1335).

* FIX: PlayerInputManager join action not triggering (#1344)

* FIX: Submit and cancel UI actions now trigger on press instead of release (#1363)

* FIX: InputControlPathDrawer showing duplicate entries (#1366)

* FIX: Broken link in CONTRIBUTIONS.md (#1367)

* FIX: WebGL gamepad up/down controls were not being inverted (#1370)

* Add XboxOne/DualShock layouts for Android (#1255)

* ADDED: DualShock4GamepadAndroid and XboxOneGamepadAndroid layout for Android

* FIX: Right stick to use AXIS.Z and AXIS.RZ for Android gamepads.

* FIX: Fixed triggers to always use Axis.Gas and Axis.Brake for Android gamepads.

Co-authored-by: Rene Damm <rene@unity3d.com>
Co-authored-by: andrew-oc <78356434+andrew-oc@users.noreply.github.com>
Co-authored-by: Andrew O'Connor <andrew.oconnor@unity3d.com>

* Updated changelog to match after merge

* Revert "Updated changelog to match after merge"

This reverts commit f83bc75.

* Revert "Merge branch 'develop' into xr-layout-builder-openxr-fixes"

This reverts commit 3037847, reversing
changes made to b87964c.

Co-authored-by: Rene Damm <rene@unity3d.com>
Co-authored-by: Dmytro Ivanov <jimon.j1m0n@gmail.com>
Co-authored-by: andrew-oc <78356434+andrew-oc@users.noreply.github.com>
Co-authored-by: Roman Osipov <31279599+RomanO-Unity@users.noreply.github.com>
Co-authored-by: Tom Baird <tomb@unity3d.com>
Co-authored-by: David Tetlow <65656964+DTetlow@users.noreply.github.com>
Co-authored-by: Håkan Sidenvall <hakan.sidenvall@unity3d.com>
Co-authored-by: Brendan Duncan <brendanduncan@gmail.com>
Co-authored-by: rytis-buz <52201119+rytis-buz@users.noreply.github.com>
Co-authored-by: Andrew O'Connor <andrew.oconnor@unity3d.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup