浏览代码

Upgrade: 2019.4.11. Added Reset Button to Rebind UI

/V2
andytouch 4 年前
当前提交
458b7485
共有 9 个文件被更改,包括 365 次插入53 次删除
  1. 321
      InputSystem_Warriors_Project/Assets/Scenes/Scene_Example_Warriors.unity
  2. 11
      InputSystem_Warriors_Project/Assets/Scripts/Behaviours/Player/PlayerController.cs
  3. 23
      InputSystem_Warriors_Project/Assets/Scripts/Behaviours/Player/PlayerVisualsBehaviour.cs
  4. 2
      InputSystem_Warriors_Project/Assets/Scripts/Behaviours/UI/UIMenuBehaviour.cs
  5. 26
      InputSystem_Warriors_Project/Assets/Scripts/Behaviours/UI/UIRebindActionBehaviour.cs
  6. 24
      InputSystem_Warriors_Project/Assets/Scripts/Utilities/DeviceDisplayConfigurator.cs
  7. 2
      InputSystem_Warriors_Project/Packages/manifest.json
  8. 5
      InputSystem_Warriors_Project/Packages/packages-lock.json
  9. 4
      InputSystem_Warriors_Project/ProjectSettings/ProjectVersion.txt

321
InputSystem_Warriors_Project/Assets/Scenes/Scene_Example_Warriors.unity


m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 124915044}
m_LocalRotation: {x: 0.05312623, y: -0.0021791146, z: 0.00011593214, w: 0.99858546}
m_LocalRotation: {x: 0.05312623, y: -0.0021791062, z: 0.00011593169, w: 0.99858546}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:

m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!114 &246201655
MonoBehaviour:
m_ObjectHideFlags: 0

- target: {fileID: 4023763117680649143, guid: c3c71f98a6fdb1a4da1aac6d2aead309,
type: 3}
propertyPath: m_fontSize
value: 18.8
value: 25.9
value: 18.8
value: 25.9
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c3c71f98a6fdb1a4da1aac6d2aead309, type: 3}

m_Script: {fileID: 11500000, guid: ad331c3afd647a044a6343361e5401a9, type: 3}
m_Name:
m_EditorClassIdentifier:
currentGameMode: 1
currentGameMode: 0
inScenePlayer: {fileID: 16277595}
singlePlayerCameraMode: 0
playerPrefab: {fileID: 1743518200311987069, guid: ca9ee4e0ea2b85646be0b08bab27e559,

- target: {fileID: 3909768097800649245, guid: a16d3c84016bb3345b08bafc1af09461,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
value: -10.699997
objectReference: {fileID: 0}
- target: {fileID: 3909768097800649245, guid: a16d3c84016bb3345b08bafc1af09461,
type: 3}

- target: {fileID: 3909768097800649245, guid: a16d3c84016bb3345b08bafc1af09461,
type: 3}
propertyPath: m_SizeDelta.x
value: -15.704926
value: -38.310043
objectReference: {fileID: 0}
- target: {fileID: 3909768097800649245, guid: a16d3c84016bb3345b08bafc1af09461,
type: 3}

- target: {fileID: 3909768097800649245, guid: a16d3c84016bb3345b08bafc1af09461,
type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
value: 0.29879844
objectReference: {fileID: 0}
- target: {fileID: 3909768097800649245, guid: a16d3c84016bb3345b08bafc1af09461,
type: 3}

- target: {fileID: 3909768097800649245, guid: a16d3c84016bb3345b08bafc1af09461,
type: 3}
propertyPath: m_AnchorMax.x
value: 1
value: 0.7013389
objectReference: {fileID: 0}
- target: {fileID: 3909768097800649245, guid: a16d3c84016bb3345b08bafc1af09461,
type: 3}

bindingNameDisplayText: {fileID: 1810209982}
bindingIconDisplayImage: {fileID: 920117029}
rebindButtonObject: {fileID: 424684447}
resetButtonObject: {fileID: 3909768098841579025}
listeningForInputObject: {fileID: 1892498254}
--- !u!1 &1456997058
GameObject:

m_Children:
- {fileID: 675367499}
m_Father: {fileID: 6680292650845814508}
m_RootOrder: 2
m_RootOrder: 3
m_AnchoredPosition: {x: 110.32, y: 1.8166}
m_SizeDelta: {x: 204.9375, y: 63.632843}
m_AnchoredPosition: {x: 63.24, y: 0.00017035007}
m_SizeDelta: {x: 304.04916, y: 59.99991}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1892498256
MonoBehaviour:

m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 10.63
m_PixelsPerUnitMultiplier: 14.5
--- !u!222 &1892498257
CanvasRenderer:
m_ObjectHideFlags: 0

m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!1 &3909768098841579025
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3909768098841579038}
- component: {fileID: 3909768098841579037}
- component: {fileID: 3909768098841579036}
- component: {fileID: 3909768098841579039}
m_Layer: 8
m_Name: UI_Button_Reset
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &3909768098841579036
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3909768098841579025}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.8679245, g: 0.8679245, b: 0.8679245, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 1e93b15590e970f4eb7c0e498f8a7d87, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 18
--- !u!222 &3909768098841579037
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3909768098841579025}
m_CullTransparentMesh: 0
--- !u!224 &3909768098841579038
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3909768098841579025}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8706195311415076770}
m_Father: {fileID: 6680292650845814508}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.29879844, y: 0}
m_AnchorMax: {x: 0.7013389, y: 1}
m_AnchoredPosition: {x: 137.5, y: -0.36700058}
m_SizeDelta: {x: -38.310043, y: -8}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &3909768098841579039
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3909768098841579025}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 0.6981132, g: 0.6981132, b: 0.6981132, a: 1}
m_HighlightedColor: {r: 0.8915094, g: 0.97985953, b: 1, a: 1}
m_PressedColor: {r: 0.8018868, g: 0.8018868, b: 0.8018868, a: 1}
m_SelectedColor: {r: 1, g: 1, b: 1, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 3909768098841579036}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1429589517}
m_MethodName: ButtonPressedResetBinding
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!1 &6680292650502469992
GameObject:
m_ObjectHideFlags: 0

m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 0.01826477, y: 0}
m_SizeDelta: {x: -0.036514282, y: 0}
m_AnchorMax: {x: 0.29879844, y: 1}
m_AnchoredPosition: {x: 0.03955078, y: 0}
m_SizeDelta: {x: -0.07914734, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &6680292650502469994
MonoBehaviour:

m_Children:
- {fileID: 6680292650502469993}
- {fileID: 1163322824}
- {fileID: 3909768098841579038}
- {fileID: 1892498255}
m_Father: {fileID: 951079147}
m_RootOrder: 0

m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8706195311415076768
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8706195311415076773}
m_CullTransparentMesh: 0
--- !u!224 &8706195311415076770
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8706195311415076773}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3909768098841579038}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &8706195311415076771
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8706195311415076773}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Reset
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 03579131436451b468aa4aa9a06e80cd, type: 2}
m_sharedMaterial: {fileID: -549880065730588403, guid: 03579131436451b468aa4aa9a06e80cd,
type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4284966759
m_fontColor: {r: 0.4056604, g: 0.4056604, b: 0.4056604, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_outlineColor:
serializedVersion: 2
rgba: 4278190080
m_fontSize: 24
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_textAlignment: 514
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_firstOverflowCharacterIndex: -1
m_linkedTextComponent: {fileID: 0}
m_isLinkedTextComponent: 0
m_isTextTruncated: 0
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_ignoreRectMaskCulling: 0
m_ignoreCulling: 1
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_VertexBufferAutoSizeReduction: 1
m_firstVisibleCharacter: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_textInfo:
textComponent: {fileID: 8706195311415076771}
characterCount: 5
spriteCount: 0
spaceCount: 0
wordCount: 1
linkCount: 0
lineCount: 1
pageCount: 1
materialCount: 1
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_spriteAnimator: {fileID: 0}
m_hasFontAssetChanged: 0
m_subTextObjects:
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
- {fileID: 0}
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &8706195311415076773
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8706195311415076770}
- component: {fileID: 8706195311415076768}
- component: {fileID: 8706195311415076771}
m_Layer: 8
m_Name: Text_Reset
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1

11
InputSystem_Warriors_Project/Assets/Scripts/Behaviours/Player/PlayerController.cs


{
playerID = newPlayerID;
playerAnimationBehaviour.SetupBehaviour();
playerVisualsBehaviour.SetupBehaviour(playerID, GetRawDevicePath());
playerVisualsBehaviour.SetupBehaviour(playerID, playerInput);
FindGameplayCamera();
}

public void OnControlsChanged()
{
playerVisualsBehaviour.UpdatePlayerVisuals(playerInput.devices[0].ToString());
playerVisualsBehaviour.UpdatePlayerVisuals();
}
public void OnDeviceLost()

IEnumerator WaitForDeviceToBeRegained()
{
yield return new WaitForSeconds(0.1f);
playerVisualsBehaviour.UpdatePlayerVisuals(playerInput.devices[0].ToString());
playerVisualsBehaviour.UpdatePlayerVisuals();
}

public int GetPlayerID()
{
return playerID;
}
public string GetRawDevicePath()
{
return playerInput.devices[0].ToString();
}
public InputActionAsset GetActionAsset()

23
InputSystem_Warriors_Project/Assets/Scripts/Behaviours/Player/PlayerVisualsBehaviour.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
public class PlayerVisualsBehaviour : MonoBehaviour
{

private PlayerInput playerInput;
[Header("Device Display Settings")]
public DeviceDisplayConfigurator deviceDisplaySettings;

private int clothingTintShaderID;
public void SetupBehaviour(int newPlayerID, string newDeviceRawPath)
public void SetupBehaviour(int newPlayerID, PlayerInput newPlayerInput)
playerInput = newPlayerInput;
UpdatePlayerVisuals(newDeviceRawPath);
UpdatePlayerVisuals();
}
void SetupShaderIDs()

public void UpdatePlayerVisuals(string deviceRawPath)
public void UpdatePlayerVisuals()
UpdateUIDisplay(deviceRawPath);
UpdateCharacterShader(deviceRawPath);
UpdateUIDisplay();
UpdateCharacterShader();
void UpdateUIDisplay(string deviceRawPath)
void UpdateUIDisplay()
string deviceName = deviceDisplaySettings.GetDeviceName(deviceRawPath);
string deviceName = deviceDisplaySettings.GetDeviceName(playerInput);
Color deviceColor = deviceDisplaySettings.GetDeviceColor(deviceRawPath);
Color deviceColor = deviceDisplaySettings.GetDeviceColor(playerInput);
void UpdateCharacterShader(string deviceRawPath)
void UpdateCharacterShader()
Color deviceColor = deviceDisplaySettings.GetDeviceColor(deviceRawPath);
Color deviceColor = deviceDisplaySettings.GetDeviceColor(playerInput);
playerSkinnedMeshRenderer.material.SetColor(clothingTintShaderID, deviceColor);
}

2
InputSystem_Warriors_Project/Assets/Scripts/Behaviours/UI/UIMenuBehaviour.cs


IDDisplayText.SetText((focusedPlayerID + 1).ToString());
//Color
Color focusedPlayerDeviceColor = deviceDisplayconfigurator.GetDeviceColor(focusedPlayerController.GetRawDevicePath());
Color focusedPlayerDeviceColor = deviceDisplayconfigurator.GetDeviceColor(focusedPlayerController.GetPlayerInput());
deviceDisplayIcon.color = focusedPlayerDeviceColor;
}

26
InputSystem_Warriors_Project/Assets/Scripts/Behaviours/UI/UIRebindActionBehaviour.cs


public TextMeshProUGUI bindingNameDisplayText;
public Image bindingIconDisplayImage;
[Header("UI Display - Rebind Button")]
[Header("UI Display - Buttons")]
public GameObject resetButtonObject;
[Header("UI Display - Listening Text")]
public GameObject listeningForInputObject;

{
ToggleGameObjectState(rebindButtonObject, false);
ToggleGameObjectState(resetButtonObject, false);
ToggleGameObjectState(listeningForInputObject, true);
rebindOperation?.Dispose();

.WithControlsExcluding("<Gamepad>/Start")
.WithControlsExcluding("<Keyboard>/p")
.OnMatchWaitForAnother(0.1f)
.OnComplete(operation => ButtonRebindCompleted());
.OnComplete(operation => RebindCompleted());
void ButtonRebindCompleted()
void RebindCompleted()
ToggleGameObjectState(resetButtonObject, true);
ToggleGameObjectState(listeningForInputObject, false);
UpdateActionDisplayUI();

public void ButtonPressedResetBinding()
{
ResetBinding();
}
void ResetBinding()
{
InputActionRebindingExtensions.RemoveAllBindingOverrides(focusedInputAction);
UpdateBindingDisplayUI();
}
UpdateBindingDisplayUI();
}
void UpdateBindingDisplayUI()

string currentRawDevicePath = focusedPlayerController.GetRawDevicePath();
string currentRawDevicePath = focusedPlayerController.GetPlayerInput().ToString();
Sprite currentDisplayIcon = deviceDisplaySettings.GetDeviceBindingIcon(currentRawDevicePath, currentBindingInput);
Sprite currentDisplayIcon = deviceDisplaySettings.GetDeviceBindingIcon(focusedPlayerInput, currentBindingInput);
if(currentDisplayIcon)
{

24
InputSystem_Warriors_Project/Assets/Scripts/Utilities/DeviceDisplayConfigurator.cs


using UnityEngine;
using System.Collections.Generic;
using UnityEngine.InputSystem;
[CreateAssetMenu(fileName = "Device Display Configurator", menuName = "Scriptable Objects/Device Display Configurator", order = 1)]
public class DeviceDisplayConfigurator : ScriptableObject

private Color fallbackDisplayColor = Color.white;
public string GetDeviceName(string playerInputDeviceRawPath)
public string GetDeviceName(PlayerInput playerInput)
string currentDeviceRawPath = playerInput.devices[0].ToString();
if(listDeviceSets[i].deviceRawPath == playerInputDeviceRawPath)
if(listDeviceSets[i].deviceRawPath == currentDeviceRawPath)
{
newDisplayName = listDeviceSets[i].deviceDisplaySettings.deviceDisplayName;
}

{
newDisplayName = playerInputDeviceRawPath;
newDisplayName = currentDeviceRawPath;
}
return newDisplayName;

public Color GetDeviceColor(string playerInputDeviceRawPath)
{
public Color GetDeviceColor(PlayerInput playerInput)
{
string currentDeviceRawPath = playerInput.devices[0].ToString();
Color newDisplayColor = fallbackDisplayColor;

if(listDeviceSets[i].deviceRawPath == playerInputDeviceRawPath)
if(listDeviceSets[i].deviceRawPath == currentDeviceRawPath)
{
newDisplayColor = listDeviceSets[i].deviceDisplaySettings.deviceDisplayColor;
}

}
public Sprite GetDeviceBindingIcon(string playerInputDeviceRawPath, string playerInputDeviceInputBinding)
public Sprite GetDeviceBindingIcon(PlayerInput playerInput, string playerInputDeviceInputBinding)
string currentDeviceRawPath = playerInput.devices[0].ToString();
if(listDeviceSets[i].deviceRawPath == playerInputDeviceRawPath)
if(listDeviceSets[i].deviceRawPath == currentDeviceRawPath)
{
if(listDeviceSets[i].deviceDisplaySettings.deviceHasContextIcons != null)
{

2
InputSystem_Warriors_Project/Packages/manifest.json


"com.unity.inputsystem": "1.0.0",
"com.unity.probuilder": "4.2.3",
"com.unity.render-pipelines.universal": "7.3.1",
"com.unity.test-framework": "1.1.14",
"com.unity.test-framework": "1.1.16",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.2.12",
"com.unity.ugui": "1.0.0",

5
InputSystem_Warriors_Project/Packages/packages-lock.json


"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.14",
"version": "1.1.16",
"depth": 0,
"source": "registry",
"dependencies": {

"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0"
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.modules.ai": {

4
InputSystem_Warriors_Project/ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2019.4.6f1
m_EditorVersionWithRevision: 2019.4.6f1 (a7aea80e3716)
m_EditorVersion: 2019.4.11f1
m_EditorVersionWithRevision: 2019.4.11f1 (2d9804dddde7)
正在加载...
取消
保存