andytouch
4 年前
当前提交
5ad7fa97
共有 44 个文件被更改,包括 3585 次插入 和 118 次删除
-
10InputSystem_LocalMultiplayer_Project/Assets/Prefabs/Warrior/Warrior.prefab
-
10InputSystem_LocalMultiplayer_Project/Assets/RenderPipeline/UniversalRenderPipelineAsset.asset
-
448InputSystem_LocalMultiplayer_Project/Assets/Scenes/Scene_Example_Warriors.unity
-
54InputSystem_LocalMultiplayer_Project/Assets/Scripts/GameManager.cs
-
29InputSystem_LocalMultiplayer_Project/Assets/Scripts/PlayerController.cs
-
47InputSystem_LocalMultiplayer_Project/Assets/Scripts/PlayerUIManager.cs
-
64InputSystem_LocalMultiplayer_Project/Assets/Warrior/Animations/AnimationController_Warrior.controller
-
334InputSystem_LocalMultiplayer_Project/Assets/Warrior/Model/Warrior_bindpose.fbx.meta
-
8InputSystem_LocalMultiplayer_Project/Assets/DistortionTrail.meta
-
8InputSystem_LocalMultiplayer_Project/Assets/Editor.meta
-
1001InputSystem_LocalMultiplayer_Project/Assets/Prefabs/UI/Panel_PlayerRebindPanel.prefab
-
7InputSystem_LocalMultiplayer_Project/Assets/Prefabs/UI/Panel_PlayerRebindPanel.prefab.meta
-
81InputSystem_LocalMultiplayer_Project/Assets/Prefabs/Warrior/Warrior_Sword.prefab
-
7InputSystem_LocalMultiplayer_Project/Assets/Prefabs/Warrior/Warrior_Sword.prefab.meta
-
139InputSystem_LocalMultiplayer_Project/Assets/Prefabs/Warrior/WeaponTrail.prefab
-
7InputSystem_LocalMultiplayer_Project/Assets/Prefabs/Warrior/WeaponTrail.prefab.meta
-
417InputSystem_LocalMultiplayer_Project/Assets/Scripts/CustomRebindUIBehaviour.cs
-
11InputSystem_LocalMultiplayer_Project/Assets/Scripts/CustomRebindUIBehaviour.cs.meta
-
62InputSystem_LocalMultiplayer_Project/Assets/Scripts/DeviceDisplayConfigurator.cs
-
49InputSystem_LocalMultiplayer_Project/Assets/Scripts/MenuUIManager.cs
-
11InputSystem_LocalMultiplayer_Project/Assets/Scripts/MenuUIManager.cs.meta
-
24InputSystem_LocalMultiplayer_Project/Assets/Scripts/PlayerRebindUIDeviceDisplayBehaviour.cs
-
11InputSystem_LocalMultiplayer_Project/Assets/Scripts/PlayerRebindUIDeviceDisplayBehaviour.cs.meta
-
183InputSystem_LocalMultiplayer_Project/Assets/Scripts/ReorderableListUtility.cs
-
11InputSystem_LocalMultiplayer_Project/Assets/Scripts/ReorderableListUtility.cs.meta
-
10InputSystem_LocalMultiplayer_Project/Assets/Scripts/SimplifyDeviceString.cs
-
11InputSystem_LocalMultiplayer_Project/Assets/Scripts/SimplifyDeviceString.cs.meta
-
27InputSystem_LocalMultiplayer_Project/Assets/DeviceDisplayConfigurator/Device Display Configurator.asset
-
8InputSystem_LocalMultiplayer_Project/Assets/DeviceDisplayConfigurator/Device Display Configurator.asset.meta
-
326InputSystem_LocalMultiplayer_Project/Assets/DistortionTrail/ShaderGraph_Distortion.shadergraph
-
10InputSystem_LocalMultiplayer_Project/Assets/DistortionTrail/ShaderGraph_Distortion.shadergraph.meta
-
3InputSystem_LocalMultiplayer_Project/Assets/DistortionTrail/Texture_Gradient_Horizontal.png
-
91InputSystem_LocalMultiplayer_Project/Assets/DistortionTrail/Texture_Gradient_Horizontal.png.meta
-
120InputSystem_LocalMultiplayer_Project/Assets/DistortionTrail/Weapon_Trail_Distortion_Mat.mat
-
8InputSystem_LocalMultiplayer_Project/Assets/DistortionTrail/Weapon_Trail_Distortion_Mat.mat.meta
-
29InputSystem_LocalMultiplayer_Project/Assets/Editor/DeviceDisplayConfiguratorEditor.cs
-
11InputSystem_LocalMultiplayer_Project/Assets/Editor/DeviceDisplayConfiguratorEditor.cs.meta
-
16InputSystem_LocalMultiplayer_Project/Assets/Scripts/DeviceColorSchemeAsset.cs
-
0/InputSystem_LocalMultiplayer_Project/Assets/Scripts/DeviceDisplayConfigurator.cs.meta
-
0/InputSystem_LocalMultiplayer_Project/Assets/DeviceDisplayConfigurator.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 01e84ccd168ee6b47bde94a3946715a4 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 4b040754be1771c4abd3bff57e84302e |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
1001
InputSystem_LocalMultiplayer_Project/Assets/Prefabs/UI/Panel_PlayerRebindPanel.prefab
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 1ff0ff9fe1f589244aee9d67ce1c6e58 |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &6637425312572303773 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 8711929540508223951} |
|||
- component: {fileID: 6369927466620346328} |
|||
- component: {fileID: 6606561210411693345} |
|||
m_Layer: 0 |
|||
m_Name: Warrior_Sword |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &8711929540508223951 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6637425312572303773} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: -1.838, y: 0, z: -4.319} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!33 &6369927466620346328 |
|||
MeshFilter: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6637425312572303773} |
|||
m_Mesh: {fileID: 4300000, guid: 9e52c160328d68b4799c73e4e5cd0ed7, type: 3} |
|||
--- !u!23 &6606561210411693345 |
|||
MeshRenderer: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 6637425312572303773} |
|||
m_Enabled: 1 |
|||
m_CastShadows: 1 |
|||
m_ReceiveShadows: 1 |
|||
m_DynamicOccludee: 1 |
|||
m_MotionVectors: 1 |
|||
m_LightProbeUsage: 1 |
|||
m_ReflectionProbeUsage: 1 |
|||
m_RayTracingMode: 2 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 2100000, guid: 75803c1c5a43b06428b2975fe0d7fc48, type: 2} |
|||
m_StaticBatchInfo: |
|||
firstSubMesh: 0 |
|||
subMeshCount: 0 |
|||
m_StaticBatchRoot: {fileID: 0} |
|||
m_ProbeAnchor: {fileID: 0} |
|||
m_LightProbeVolumeOverride: {fileID: 0} |
|||
m_ScaleInLightmap: 1 |
|||
m_ReceiveGI: 1 |
|||
m_PreserveUVs: 0 |
|||
m_IgnoreNormalsForChartDetection: 0 |
|||
m_ImportantGI: 0 |
|||
m_StitchLightmapSeams: 1 |
|||
m_SelectedEditorRenderState: 3 |
|||
m_MinimumChartSize: 4 |
|||
m_AutoUVMaxDistance: 0.5 |
|||
m_AutoUVMaxAngle: 89 |
|||
m_LightmapParameters: {fileID: 0} |
|||
m_SortingLayerID: 0 |
|||
m_SortingLayer: 0 |
|||
m_SortingOrder: 0 |
|
|||
fileFormatVersion: 2 |
|||
guid: fb2f156c2bd1e104aa57143a8ca00a6f |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!1 &8461215612231668206 |
|||
GameObject: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
serializedVersion: 6 |
|||
m_Component: |
|||
- component: {fileID: 8461215612231668207} |
|||
- component: {fileID: 8461215612231668204} |
|||
m_Layer: 0 |
|||
m_Name: WeaponTrail |
|||
m_TagString: Untagged |
|||
m_Icon: {fileID: 0} |
|||
m_NavMeshLayer: 0 |
|||
m_StaticEditorFlags: 0 |
|||
m_IsActive: 1 |
|||
--- !u!4 &8461215612231668207 |
|||
Transform: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8461215612231668206} |
|||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} |
|||
m_LocalPosition: {x: 1.777, y: 0.506, z: 0} |
|||
m_LocalScale: {x: 1, y: 1, z: 1} |
|||
m_Children: [] |
|||
m_Father: {fileID: 0} |
|||
m_RootOrder: 0 |
|||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} |
|||
--- !u!96 &8461215612231668204 |
|||
TrailRenderer: |
|||
serializedVersion: 2 |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 8461215612231668206} |
|||
m_Enabled: 1 |
|||
m_CastShadows: 0 |
|||
m_ReceiveShadows: 1 |
|||
m_DynamicOccludee: 1 |
|||
m_MotionVectors: 1 |
|||
m_LightProbeUsage: 0 |
|||
m_ReflectionProbeUsage: 0 |
|||
m_RayTracingMode: 0 |
|||
m_RenderingLayerMask: 1 |
|||
m_RendererPriority: 0 |
|||
m_Materials: |
|||
- {fileID: 2100000, guid: 6ddc3ed69fff44c409ff48f83a177748, type: 2} |
|||
m_StaticBatchInfo: |
|||
firstSubMesh: 0 |
|||
subMeshCount: 0 |
|||
m_StaticBatchRoot: {fileID: 0} |
|||
m_ProbeAnchor: {fileID: 0} |
|||
m_LightProbeVolumeOverride: {fileID: 0} |
|||
m_ScaleInLightmap: 1 |
|||
m_ReceiveGI: 1 |
|||
m_PreserveUVs: 0 |
|||
m_IgnoreNormalsForChartDetection: 0 |
|||
m_ImportantGI: 0 |
|||
m_StitchLightmapSeams: 1 |
|||
m_SelectedEditorRenderState: 3 |
|||
m_MinimumChartSize: 4 |
|||
m_AutoUVMaxDistance: 0.5 |
|||
m_AutoUVMaxAngle: 89 |
|||
m_LightmapParameters: {fileID: 0} |
|||
m_SortingLayerID: 0 |
|||
m_SortingLayer: 0 |
|||
m_SortingOrder: 0 |
|||
m_Time: 30 |
|||
m_Parameters: |
|||
serializedVersion: 3 |
|||
widthMultiplier: 1 |
|||
widthCurve: |
|||
serializedVersion: 2 |
|||
m_Curve: |
|||
- serializedVersion: 3 |
|||
time: 0 |
|||
value: 1 |
|||
inSlope: 0 |
|||
outSlope: 0 |
|||
tangentMode: 0 |
|||
weightedMode: 0 |
|||
inWeight: 0.33333334 |
|||
outWeight: 0.33333334 |
|||
- serializedVersion: 3 |
|||
time: 1 |
|||
value: 0 |
|||
inSlope: -2.1708405 |
|||
outSlope: -2.1708405 |
|||
tangentMode: 0 |
|||
weightedMode: 0 |
|||
inWeight: 0.32124352 |
|||
outWeight: 0 |
|||
m_PreInfinity: 2 |
|||
m_PostInfinity: 2 |
|||
m_RotationOrder: 4 |
|||
colorGradient: |
|||
serializedVersion: 2 |
|||
key0: {r: 1, g: 1, b: 1, a: 1} |
|||
key1: {r: 1, g: 1, b: 1, a: 1} |
|||
key2: {r: 0, g: 0, b: 0, a: 0} |
|||
key3: {r: 0, g: 0, b: 0, a: 0} |
|||
key4: {r: 0, g: 0, b: 0, a: 0} |
|||
key5: {r: 0, g: 0, b: 0, a: 0} |
|||
key6: {r: 0, g: 0, b: 0, a: 0} |
|||
key7: {r: 0, g: 0, b: 0, a: 0} |
|||
ctime0: 0 |
|||
ctime1: 65535 |
|||
ctime2: 0 |
|||
ctime3: 0 |
|||
ctime4: 0 |
|||
ctime5: 0 |
|||
ctime6: 0 |
|||
ctime7: 0 |
|||
atime0: 0 |
|||
atime1: 65535 |
|||
atime2: 65535 |
|||
atime3: 0 |
|||
atime4: 0 |
|||
atime5: 0 |
|||
atime6: 0 |
|||
atime7: 0 |
|||
m_Mode: 0 |
|||
m_NumColorKeys: 2 |
|||
m_NumAlphaKeys: 2 |
|||
numCornerVertices: 0 |
|||
numCapVertices: 0 |
|||
alignment: 1 |
|||
textureMode: 2 |
|||
shadowBias: 0.5 |
|||
generateLightingData: 0 |
|||
m_MinVertexDistance: 0.01 |
|||
m_Autodestruct: 1 |
|||
m_Emitting: 1 |
|
|||
fileFormatVersion: 2 |
|||
guid: 7add984aa101198469845a27c4df457b |
|||
PrefabImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using UnityEngine.Events; |
|||
using UnityEngine.InputSystem; |
|||
using UnityEngine.InputSystem.Utilities; |
|||
using UnityEngine.UI; |
|||
using UnityEngine; |
|||
using TMPro; |
|||
|
|||
////TODO: localization support
|
|||
|
|||
////TODO: deal with composites that have parts bound in different control schemes
|
|||
|
|||
|
|||
|
|||
public class CustomRebindUIBehaviour : MonoBehaviour |
|||
{ |
|||
|
|||
public InputActionReference actionReference |
|||
{ |
|||
get => m_Action; |
|||
set |
|||
{ |
|||
m_Action = value; |
|||
UpdateActionLabel(); |
|||
UpdateBindingDisplay(); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// ID (in string form) of the binding that is to be rebound on the action.
|
|||
/// </summary>
|
|||
/// <seealso cref="InputBinding.id"/>
|
|||
public string bindingId |
|||
{ |
|||
get => m_BindingId; |
|||
set |
|||
{ |
|||
m_BindingId = value; |
|||
UpdateBindingDisplay(); |
|||
} |
|||
} |
|||
|
|||
public InputBinding.DisplayStringOptions displayStringOptions |
|||
{ |
|||
get => m_DisplayStringOptions; |
|||
set |
|||
{ |
|||
m_DisplayStringOptions = value; |
|||
UpdateBindingDisplay(); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Text component that receives the name of the action. Optional.
|
|||
/// </summary>
|
|||
public TextMeshProUGUI actionLabel |
|||
{ |
|||
get => m_ActionLabel; |
|||
set |
|||
{ |
|||
m_ActionLabel = value; |
|||
UpdateActionLabel(); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Text component that receives the display string of the binding. Can be <c>null</c> in which
|
|||
/// case the component entirely relies on <see cref="updateBindingUIEvent"/>.
|
|||
/// </summary>
|
|||
public TextMeshProUGUI bindingText |
|||
{ |
|||
get => m_BindingText; |
|||
set |
|||
{ |
|||
m_BindingText = value; |
|||
UpdateBindingDisplay(); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Optional UI that is activated when an interactive rebind is started and deactivated when the rebind
|
|||
/// is finished. This is normally used to display an overlay over the current UI while the system is
|
|||
/// waiting for a control to be actuated.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// If neither <see cref="rebindPrompt"/> nor <c>rebindOverlay</c> is set, the component will temporarily
|
|||
/// replaced the <see cref="bindingText"/> (if not <c>null</c>) with <c>"Waiting..."</c>.
|
|||
/// </remarks>
|
|||
/// <seealso cref="startRebindEvent"/>
|
|||
/// <seealso cref="rebindPrompt"/>
|
|||
public GameObject rebindOverlay |
|||
{ |
|||
get => m_RebindOverlay; |
|||
set => m_RebindOverlay = value; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Event that is triggered every time the UI updates to reflect the current binding.
|
|||
/// This can be used to tie custom visualizations to bindings.
|
|||
/// </summary>
|
|||
public UpdateBindingUIEvent updateBindingUIEvent |
|||
{ |
|||
get |
|||
{ |
|||
if (m_UpdateBindingUIEvent == null) |
|||
m_UpdateBindingUIEvent = new UpdateBindingUIEvent(); |
|||
return m_UpdateBindingUIEvent; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Event that is triggered when an interactive rebind is started on the action.
|
|||
/// </summary>
|
|||
public InteractiveRebindEvent startRebindEvent |
|||
{ |
|||
get |
|||
{ |
|||
if (m_RebindStartEvent == null) |
|||
m_RebindStartEvent = new InteractiveRebindEvent(); |
|||
return m_RebindStartEvent; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Event that is triggered when an interactive rebind has been completed or canceled.
|
|||
/// </summary>
|
|||
public InteractiveRebindEvent stopRebindEvent |
|||
{ |
|||
get |
|||
{ |
|||
if (m_RebindStopEvent == null) |
|||
m_RebindStopEvent = new InteractiveRebindEvent(); |
|||
return m_RebindStopEvent; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// When an interactive rebind is in progress, this is the rebind operation controller.
|
|||
/// Otherwise, it is <c>null</c>.
|
|||
/// </summary>
|
|||
public InputActionRebindingExtensions.RebindingOperation ongoingRebind => m_RebindOperation; |
|||
|
|||
/// <summary>
|
|||
/// Return the action and binding index for the binding that is targeted by the component
|
|||
/// according to
|
|||
/// </summary>
|
|||
/// <param name="action"></param>
|
|||
/// <param name="bindingIndex"></param>
|
|||
/// <returns></returns>
|
|||
public bool ResolveActionAndBinding(out InputAction action, out int bindingIndex) |
|||
{ |
|||
bindingIndex = -1; |
|||
|
|||
action = m_Action?.action; |
|||
if (action == null) |
|||
return false; |
|||
|
|||
if (string.IsNullOrEmpty(m_BindingId)) |
|||
return false; |
|||
|
|||
// Look up binding index.
|
|||
var bindingId = new Guid(m_BindingId); |
|||
bindingIndex = action.bindings.IndexOf(x => x.id == bindingId); |
|||
if (bindingIndex == -1) |
|||
{ |
|||
Debug.LogError($"Cannot find binding with ID '{bindingId}' on '{action}'", this); |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Trigger a refresh of the currently displayed binding.
|
|||
/// </summary>
|
|||
public void UpdateBindingDisplay() |
|||
{ |
|||
var displayString = string.Empty; |
|||
var deviceLayoutName = default(string); |
|||
var controlPath = default(string); |
|||
|
|||
// Get display string from action.
|
|||
var action = m_Action?.action; |
|||
if (action != null) |
|||
{ |
|||
var bindingIndex = action.bindings.IndexOf(x => x.id.ToString() == m_BindingId); |
|||
if (bindingIndex != -1) |
|||
displayString = action.GetBindingDisplayString(bindingIndex, out deviceLayoutName, out controlPath, displayStringOptions); |
|||
} |
|||
|
|||
// Set on label (if any).
|
|||
if (m_BindingText != null) |
|||
m_BindingText.SetText(displayString); |
|||
|
|||
// Give listeners a chance to configure UI in response.
|
|||
m_UpdateBindingUIEvent?.Invoke(this, displayString, deviceLayoutName, controlPath); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Remove currently applied binding overrides.
|
|||
/// </summary>
|
|||
public void ResetToDefault() |
|||
{ |
|||
if (!ResolveActionAndBinding(out var action, out var bindingIndex)) |
|||
return; |
|||
|
|||
if (action.bindings[bindingIndex].isComposite) |
|||
{ |
|||
// It's a composite. Remove overrides from part bindings.
|
|||
for (var i = bindingIndex + 1; i < action.bindings.Count && action.bindings[i].isPartOfComposite; ++i) |
|||
action.RemoveBindingOverride(i); |
|||
} |
|||
else |
|||
{ |
|||
action.RemoveBindingOverride(bindingIndex); |
|||
} |
|||
UpdateBindingDisplay(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Initiate an interactive rebind that lets the player actuate a control to choose a new binding
|
|||
/// for the action.
|
|||
/// </summary>
|
|||
public void StartInteractiveRebind() |
|||
{ |
|||
if (!ResolveActionAndBinding(out var action, out var bindingIndex)) |
|||
return; |
|||
|
|||
// If the binding is a composite, we need to rebind each part in turn.
|
|||
if (action.bindings[bindingIndex].isComposite) |
|||
{ |
|||
var firstPartIndex = bindingIndex + 1; |
|||
if (firstPartIndex < action.bindings.Count && action.bindings[firstPartIndex].isPartOfComposite) |
|||
PerformInteractiveRebind(action, firstPartIndex, allCompositeParts: true); |
|||
} |
|||
else |
|||
{ |
|||
PerformInteractiveRebind(action, bindingIndex); |
|||
} |
|||
} |
|||
|
|||
private void PerformInteractiveRebind(InputAction action, int bindingIndex, bool allCompositeParts = false) |
|||
{ |
|||
m_RebindOperation?.Cancel(); // Will null out m_RebindOperation.
|
|||
|
|||
void CleanUp() |
|||
{ |
|||
m_RebindOperation?.Dispose(); |
|||
m_RebindOperation = null; |
|||
} |
|||
|
|||
// Configure the rebind.
|
|||
m_RebindOperation = action.PerformInteractiveRebinding(bindingIndex) |
|||
.OnCancel( |
|||
operation => |
|||
{ |
|||
m_RebindStopEvent?.Invoke(this, operation); |
|||
m_RebindOverlay?.SetActive(false); |
|||
UpdateBindingDisplay(); |
|||
CleanUp(); |
|||
}) |
|||
.OnComplete( |
|||
operation => |
|||
{ |
|||
m_RebindOverlay?.SetActive(false); |
|||
m_RebindStopEvent?.Invoke(this, operation); |
|||
UpdateBindingDisplay(); |
|||
CleanUp(); |
|||
|
|||
// If there's more composite parts we should bind, initiate a rebind
|
|||
// for the next part.
|
|||
if (allCompositeParts) |
|||
{ |
|||
var nextBindingIndex = bindingIndex + 1; |
|||
if (nextBindingIndex < action.bindings.Count && action.bindings[nextBindingIndex].isPartOfComposite) |
|||
PerformInteractiveRebind(action, nextBindingIndex, true); |
|||
} |
|||
}); |
|||
|
|||
// If it's a part binding, show the name of the part in the UI.
|
|||
var partName = default(string); |
|||
if (action.bindings[bindingIndex].isPartOfComposite) |
|||
partName = $"Binding '{action.bindings[bindingIndex].name}'. "; |
|||
|
|||
// Bring up rebind overlay, if we have one.
|
|||
m_RebindOverlay?.SetActive(true); |
|||
|
|||
// Give listeners a chance to act on the rebind starting.
|
|||
m_RebindStartEvent?.Invoke(this, m_RebindOperation); |
|||
|
|||
m_RebindOperation.Start(); |
|||
} |
|||
|
|||
protected void OnEnable() |
|||
{ |
|||
if (s_RebindActionUIs == null) |
|||
s_RebindActionUIs = new List<CustomRebindUIBehaviour>(); |
|||
s_RebindActionUIs.Add(this); |
|||
if (s_RebindActionUIs.Count == 1) |
|||
InputSystem.onActionChange += OnActionChange; |
|||
} |
|||
|
|||
protected void OnDisable() |
|||
{ |
|||
m_RebindOperation?.Dispose(); |
|||
m_RebindOperation = null; |
|||
|
|||
s_RebindActionUIs.Remove(this); |
|||
if (s_RebindActionUIs.Count == 0) |
|||
{ |
|||
s_RebindActionUIs = null; |
|||
InputSystem.onActionChange -= OnActionChange; |
|||
} |
|||
} |
|||
|
|||
// When the action system re-resolves bindings, we want to update our UI in response. While this will
|
|||
// also trigger from changes we made ourselves, it ensures that we react to changes made elsewhere. If
|
|||
// the user changes keyboard layout, for example, we will get a BoundControlsChanged notification and
|
|||
// will update our UI to reflect the current keyboard layout.
|
|||
private static void OnActionChange(object obj, InputActionChange change) |
|||
{ |
|||
if (change != InputActionChange.BoundControlsChanged) |
|||
return; |
|||
|
|||
var action = obj as InputAction; |
|||
var actionMap = action?.actionMap ?? obj as InputActionMap; |
|||
var actionAsset = actionMap?.asset ?? obj as InputActionAsset; |
|||
|
|||
for (var i = 0; i < s_RebindActionUIs.Count; ++i) |
|||
{ |
|||
var component = s_RebindActionUIs[i]; |
|||
var referencedAction = component.actionReference?.action; |
|||
if (referencedAction == null) |
|||
continue; |
|||
|
|||
if (referencedAction == action || |
|||
referencedAction.actionMap == actionMap || |
|||
referencedAction.actionMap?.asset == actionAsset) |
|||
component.UpdateBindingDisplay(); |
|||
} |
|||
} |
|||
|
|||
[Tooltip("Reference to action that is to be rebound from the UI.")] |
|||
[SerializeField] |
|||
private InputActionReference m_Action; |
|||
|
|||
[SerializeField] |
|||
private string m_BindingId; |
|||
|
|||
[SerializeField] |
|||
private InputBinding.DisplayStringOptions m_DisplayStringOptions; |
|||
|
|||
[Tooltip("Text label that will receive the name of the action. Optional. Set to None to have the " |
|||
+ "rebind UI not show a label for the action.")] |
|||
[SerializeField] |
|||
private TextMeshProUGUI m_ActionLabel; |
|||
|
|||
[Tooltip("Text label that will receive the current, formatted binding string.")] |
|||
[SerializeField] |
|||
private TextMeshProUGUI m_BindingText; |
|||
|
|||
[Tooltip("Optional UI that will be shown while a rebind is in progress.")] |
|||
[SerializeField] |
|||
private GameObject m_RebindOverlay; |
|||
|
|||
[Tooltip("Event that is triggered when the way the binding is display should be updated. This allows displaying " |
|||
+ "bindings in custom ways, e.g. using images instead of text.")] |
|||
[SerializeField] |
|||
private UpdateBindingUIEvent m_UpdateBindingUIEvent; |
|||
|
|||
[Tooltip("Event that is triggered when an interactive rebind is being initiated. This can be used, for example, " |
|||
+ "to implement custom UI behavior while a rebind is in progress. It can also be used to further " |
|||
+ "customize the rebind.")] |
|||
[SerializeField] |
|||
private InteractiveRebindEvent m_RebindStartEvent; |
|||
|
|||
[Tooltip("Event that is triggered when an interactive rebind is complete or has been aborted.")] |
|||
[SerializeField] |
|||
private InteractiveRebindEvent m_RebindStopEvent; |
|||
|
|||
private InputActionRebindingExtensions.RebindingOperation m_RebindOperation; |
|||
|
|||
private static List<CustomRebindUIBehaviour> s_RebindActionUIs; |
|||
|
|||
// We want the label for the action name to update in edit mode, too, so
|
|||
// we kick that off from here.
|
|||
#if UNITY_EDITOR
|
|||
protected void OnValidate() |
|||
{ |
|||
UpdateActionLabel(); |
|||
UpdateBindingDisplay(); |
|||
} |
|||
|
|||
#endif
|
|||
|
|||
private void UpdateActionLabel() |
|||
{ |
|||
if (m_ActionLabel != null) |
|||
{ |
|||
var action = m_Action?.action; |
|||
m_ActionLabel.text = action != null ? action.name : string.Empty; |
|||
} |
|||
} |
|||
|
|||
[Serializable] |
|||
public class UpdateBindingUIEvent : UnityEvent<CustomRebindUIBehaviour, string, string, string> |
|||
{ |
|||
} |
|||
|
|||
[Serializable] |
|||
public class InteractiveRebindEvent : UnityEvent<CustomRebindUIBehaviour, InputActionRebindingExtensions.RebindingOperation> |
|||
{ |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: 87aafa8c3edbaeb4eb9e418fbb29a389 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using System.Collections.Generic; |
|||
|
|||
[CreateAssetMenu(fileName = "Device Display Configurator", menuName = "Scriptable Objects/Device Display Configurator", order = 1)] |
|||
public class DeviceDisplayConfigurator : ScriptableObject |
|||
{ |
|||
|
|||
[System.Serializable] |
|||
public struct DeviceSettings |
|||
{ |
|||
public string deviceRawPath; |
|||
public string deviceDisplayName; |
|||
public Color deviceDisplayColor; |
|||
} |
|||
|
|||
public List<DeviceSettings> deviceSettings = new List<DeviceSettings>(); |
|||
|
|||
private Color fallbackDisplayColor = Color.white; |
|||
|
|||
|
|||
public string GetDeviceDisplayName(string playerInputDeviceRawPath) |
|||
{ |
|||
string newDisplayName = null; |
|||
|
|||
for(int i = 0; i < deviceSettings.Count; i++) |
|||
{ |
|||
|
|||
if(deviceSettings[i].deviceRawPath == playerInputDeviceRawPath) |
|||
{ |
|||
newDisplayName = deviceSettings[i].deviceDisplayName; |
|||
} |
|||
} |
|||
|
|||
if(newDisplayName == null) |
|||
{ |
|||
newDisplayName = playerInputDeviceRawPath; |
|||
} |
|||
|
|||
return newDisplayName; |
|||
|
|||
} |
|||
|
|||
|
|||
public Color GetDeviceDisplayColor(string playerInputDeviceRawPath) |
|||
{ |
|||
|
|||
Color newDisplayColor = fallbackDisplayColor; |
|||
|
|||
for(int i = 0; i < deviceSettings.Count; i++) |
|||
{ |
|||
|
|||
if(deviceSettings[i].deviceRawPath == playerInputDeviceRawPath) |
|||
{ |
|||
newDisplayColor = deviceSettings[i].deviceDisplayColor; |
|||
} |
|||
} |
|||
|
|||
return newDisplayColor; |
|||
|
|||
} |
|||
|
|||
} |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using UnityEngine.UI; |
|||
using UnityEngine.InputSystem; |
|||
using UnityEngine.InputSystem.Utilities; |
|||
|
|||
public class MenuUIManager : Singleton<MenuUIManager> |
|||
{ |
|||
[Header("References")] |
|||
public Canvas menuCanvas; |
|||
|
|||
[Header("In-Scene Player Panel")] |
|||
public GameObject inScenePlayerRebindPanel; |
|||
|
|||
[Header("Player Panel Settings")] |
|||
public GameObject playerRebindPanelPrefab; |
|||
public Transform playerRebindListRoot; |
|||
|
|||
public void UpdateRebindPlayerPanelList() |
|||
{ |
|||
|
|||
Destroy(inScenePlayerRebindPanel); |
|||
|
|||
|
|||
List<PlayerController> activePlayerControllers = GameManager.Instance.GetActivePlayerControllers(); |
|||
|
|||
for(int i = 0; i < activePlayerControllers.Count; i++) |
|||
{ |
|||
GameObject spawnedPlayerRebindPanel = Instantiate(playerRebindPanelPrefab, playerRebindListRoot.position, playerRebindListRoot.rotation) as GameObject; |
|||
spawnedPlayerRebindPanel.transform.SetParent(playerRebindListRoot, false); |
|||
|
|||
PlayerInput spawnedPlayerInput = activePlayerControllers[i].GetPlayerInput(); |
|||
|
|||
int spawnedPlayerIndex = spawnedPlayerInput.playerIndex; |
|||
string spawnedPlayerDevicePath = spawnedPlayerInput.devices[0].ToString(); |
|||
|
|||
spawnedPlayerRebindPanel.GetComponent<PlayerRebindUIDeviceDisplayBehaviour>().SetupPanelDisplays(spawnedPlayerIndex, spawnedPlayerDevicePath); |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
|
|||
public void ToggleMenu(bool newState) |
|||
{ |
|||
menuCanvas.enabled = newState; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: cfad211f8c6ebe348bfc0d302db7da52 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using UnityEngine; |
|||
using TMPro; |
|||
|
|||
public class PlayerRebindUIDeviceDisplayBehaviour : MonoBehaviour |
|||
{ |
|||
|
|||
[Header("Device Display")] |
|||
public DeviceDisplayConfigurator deviceDisplayConfigurator; |
|||
|
|||
[Header("Display References")] |
|||
public TextMeshProUGUI playerIDDisplay; |
|||
public TextMeshProUGUI playerDeviceDisplay; |
|||
|
|||
public void SetupPanelDisplays(int playerID, string playerDevicePath) |
|||
{ |
|||
playerIDDisplay.SetText("Player " + (playerID + 1)); |
|||
|
|||
playerDeviceDisplay.SetText(deviceDisplayConfigurator.GetDeviceDisplayName(playerDevicePath)); |
|||
playerDeviceDisplay.color = deviceDisplayConfigurator.GetDeviceDisplayColor(playerDevicePath); |
|||
|
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3f18ceab1bac8124c8f055b165452183 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
//
|
|||
// Copyright (c) 2016 Siyuan Wang.
|
|||
// Licensed under the Apache License Version 2.0. See LICENSE file in the project root for full license information.
|
|||
//
|
|||
|
|||
using System.Collections.Generic; |
|||
using UnityEditor; |
|||
using UnityEditorInternal; |
|||
using UnityEngine; |
|||
|
|||
public static class ReorderableListUtility |
|||
{ |
|||
public static ReorderableList CreateAutoLayout(SerializedProperty property, float columnSpacing = 10f) |
|||
{ |
|||
return CreateAutoLayout(property, true, true, true, true, null, null, columnSpacing); |
|||
} |
|||
|
|||
public static ReorderableList CreateAutoLayout(SerializedProperty property, string[] headers, float?[] columnWidth = null, float columnSpacing = 10f) |
|||
{ |
|||
return CreateAutoLayout(property, true, true, true, true, headers, columnWidth, columnSpacing); |
|||
} |
|||
|
|||
public static ReorderableList CreateAutoLayout(SerializedProperty property, bool draggable, bool displayHeader, bool displayAddButton, bool displayRemoveButton, float columnSpacing = 10f) |
|||
{ |
|||
return CreateAutoLayout(property, draggable, displayHeader, displayAddButton, displayRemoveButton, null, null, columnSpacing); |
|||
} |
|||
|
|||
public static ReorderableList CreateAutoLayout(SerializedProperty property, bool draggable, bool displayHeader, bool displayAddButton, bool displayRemoveButton, string[] headers, float?[] columnWidth = null, float columnSpacing = 10f) |
|||
{ |
|||
var list = new ReorderableList(property.serializedObject, property, draggable, displayHeader, displayAddButton, displayRemoveButton); |
|||
var colmuns = new List<Column>(); |
|||
|
|||
list.drawElementCallback = DrawElement(list, GetColumnsFunc(list, headers, columnWidth, colmuns), columnSpacing); |
|||
list.drawHeaderCallback = DrawHeader(list, GetColumnsFunc(list, headers, columnWidth, colmuns), columnSpacing); |
|||
|
|||
return list; |
|||
} |
|||
|
|||
public static bool DoLayoutListWithFoldout(ReorderableList list, string label = null) |
|||
{ |
|||
var property = list.serializedProperty; |
|||
property.isExpanded = EditorGUILayout.Foldout(property.isExpanded, label != null ? label : property.displayName); |
|||
if (property.isExpanded) |
|||
{ |
|||
list.DoLayoutList(); |
|||
} |
|||
|
|||
return property.isExpanded; |
|||
} |
|||
|
|||
private static ReorderableList.ElementCallbackDelegate DrawElement(ReorderableList list, System.Func<List<Column>> getColumns, float columnSpacing) |
|||
{ |
|||
return (rect, index, isActive, isFocused) => |
|||
{ |
|||
var property = list.serializedProperty; |
|||
var columns = getColumns(); |
|||
var layouts = CalculateColumnLayout(columns, rect, columnSpacing); |
|||
|
|||
var arect = rect; |
|||
arect.height = EditorGUIUtility.singleLineHeight; |
|||
for (var ii = 0; ii < columns.Count; ii++) |
|||
{ |
|||
var c = columns[ii]; |
|||
|
|||
arect.width = layouts[ii]; |
|||
EditorGUI.PropertyField(arect, property.GetArrayElementAtIndex(index).FindPropertyRelative(c.PropertyName), GUIContent.none); |
|||
arect.x += arect.width + columnSpacing; |
|||
} |
|||
}; |
|||
} |
|||
|
|||
private static ReorderableList.HeaderCallbackDelegate DrawHeader(ReorderableList list, System.Func<List<Column>> getColumns, float columnSpacing) |
|||
{ |
|||
return (rect) => |
|||
{ |
|||
var columns = getColumns(); |
|||
|
|||
if (list.draggable) |
|||
{ |
|||
rect.width -= 15; |
|||
rect.x += 15; |
|||
} |
|||
|
|||
var layouts = CalculateColumnLayout(columns, rect, columnSpacing); |
|||
var arect = rect; |
|||
arect.height = EditorGUIUtility.singleLineHeight; |
|||
for (var ii = 0; ii < columns.Count; ii++) |
|||
{ |
|||
var c = columns[ii]; |
|||
|
|||
arect.width = layouts[ii]; |
|||
EditorGUI.LabelField(arect, c.DisplayName); |
|||
arect.x += arect.width + columnSpacing; |
|||
} |
|||
}; |
|||
} |
|||
|
|||
private static System.Func<List<Column>> GetColumnsFunc(ReorderableList list, string[] headers, float?[] columnWidth, List<Column> output) |
|||
{ |
|||
var property = list.serializedProperty; |
|||
return () => |
|||
{ |
|||
if (output.Count <= 0 || list.serializedProperty != property) |
|||
{ |
|||
output.Clear(); |
|||
property = list.serializedProperty; |
|||
|
|||
if (property.isArray && property.arraySize > 0) |
|||
{ |
|||
var it = property.GetArrayElementAtIndex(0).Copy(); |
|||
var prefix = it.propertyPath; |
|||
var index = 0; |
|||
if (it.Next(true)) |
|||
{ |
|||
do |
|||
{ |
|||
if (it.propertyPath.StartsWith(prefix)) |
|||
{ |
|||
var c = new Column(); |
|||
c.DisplayName = (headers != null && headers.Length > index) ? headers[index] : it.displayName; |
|||
c.PropertyName = it.propertyPath.Substring(prefix.Length + 1); |
|||
c.Width = (columnWidth != null && columnWidth.Length > index) ? columnWidth[index] : null; |
|||
|
|||
output.Add(c); |
|||
} |
|||
else |
|||
{ |
|||
break; |
|||
} |
|||
|
|||
index += 1; |
|||
} |
|||
while (it.Next(false)); |
|||
} |
|||
} |
|||
} |
|||
|
|||
return output; |
|||
}; |
|||
} |
|||
|
|||
private static List<float> CalculateColumnLayout(List<Column> columns, Rect rect, float columnSpacing) |
|||
{ |
|||
var autoWidth = rect.width; |
|||
var autoCount = 0; |
|||
foreach (var column in columns) |
|||
{ |
|||
if (column.Width.HasValue) |
|||
{ |
|||
autoWidth -= column.Width.Value; |
|||
} |
|||
else |
|||
{ |
|||
autoCount += 1; |
|||
} |
|||
} |
|||
|
|||
autoWidth -= (columns.Count - 1) * columnSpacing; |
|||
autoWidth /= autoCount; |
|||
|
|||
var widths = new List<float>(columns.Count); |
|||
foreach (var column in columns) |
|||
{ |
|||
if (column.Width.HasValue) |
|||
{ |
|||
widths.Add(column.Width.Value); |
|||
} |
|||
else |
|||
{ |
|||
widths.Add(autoWidth); |
|||
} |
|||
} |
|||
|
|||
return widths; |
|||
} |
|||
|
|||
private struct Column |
|||
{ |
|||
public string DisplayName; |
|||
public string PropertyName; |
|||
public float? Width; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: f80afc2351fc1b34d965907fa53d8db0 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
|
|||
public static class SimplifyDeviceString |
|||
{ |
|||
public static string GetName() |
|||
{ |
|||
return "Hello"; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 7239265b2b6ab0740a16f8fa4be30d56 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: fa6f1fbaea804c34cab896669f1e362b, type: 3} |
|||
m_Name: Device Display Configurator |
|||
m_EditorClassIdentifier: |
|||
deviceSettings: |
|||
- deviceRawPath: Keyboard:/Keyboard |
|||
deviceDisplayName: Keyboard |
|||
deviceDisplayColor: {r: 0.7830189, g: 0.7830189, b: 0.7830189, a: 1} |
|||
- deviceRawPath: XInputControllerWindows:/XInputControllerWindows |
|||
deviceDisplayName: Xbox Controller |
|||
deviceDisplayColor: {r: 0.080098376, g: 0.698, b: 0.074377045, a: 1} |
|||
- deviceRawPath: DualShock4GamepadHID:/DualShock4GamepadHID |
|||
deviceDisplayName: Playstation Controller |
|||
deviceDisplayColor: {r: 0.20485054, g: 0.25336775, b: 0.938, a: 1} |
|||
- deviceRawPath: SwitchProControllerHID:/SwitchProControllerHID |
|||
deviceDisplayName: Nintendo Switch Pro Controller |
|||
deviceDisplayColor: {r: 1, g: 0, b: 0.080357075, a: 1} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1ae90af367a37dc47b0ecc2b81a75099 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
326
InputSystem_LocalMultiplayer_Project/Assets/DistortionTrail/ShaderGraph_Distortion.shadergraph
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
fileFormatVersion: 2 |
|||
guid: 6f2be88008c45e747b2cbf1018394612 |
|||
ScriptedImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} |
|
|||
fileFormatVersion: 2 |
|||
guid: ff8d2362415c115408cdcf06000dec66 |
|||
TextureImporter: |
|||
internalIDToNameTable: [] |
|||
externalObjects: {} |
|||
serializedVersion: 10 |
|||
mipmaps: |
|||
mipMapMode: 0 |
|||
enableMipMap: 1 |
|||
sRGBTexture: 1 |
|||
linearTexture: 0 |
|||
fadeOut: 0 |
|||
borderMipMap: 0 |
|||
mipMapsPreserveCoverage: 0 |
|||
alphaTestReferenceValue: 0.5 |
|||
mipMapFadeDistanceStart: 1 |
|||
mipMapFadeDistanceEnd: 3 |
|||
bumpmap: |
|||
convertToNormalMap: 0 |
|||
externalNormalMap: 0 |
|||
heightScale: 0.25 |
|||
normalMapFilter: 0 |
|||
isReadable: 0 |
|||
streamingMipmaps: 0 |
|||
streamingMipmapsPriority: 0 |
|||
grayScaleToAlpha: 0 |
|||
generateCubemap: 6 |
|||
cubemapConvolution: 0 |
|||
seamlessCubemap: 0 |
|||
textureFormat: 1 |
|||
maxTextureSize: 2048 |
|||
textureSettings: |
|||
serializedVersion: 2 |
|||
filterMode: -1 |
|||
aniso: -1 |
|||
mipBias: -100 |
|||
wrapU: -1 |
|||
wrapV: -1 |
|||
wrapW: -1 |
|||
nPOTScale: 1 |
|||
lightmap: 0 |
|||
compressionQuality: 50 |
|||
spriteMode: 0 |
|||
spriteExtrude: 1 |
|||
spriteMeshType: 1 |
|||
alignment: 0 |
|||
spritePivot: {x: 0.5, y: 0.5} |
|||
spritePixelsToUnits: 100 |
|||
spriteBorder: {x: 0, y: 0, z: 0, w: 0} |
|||
spriteGenerateFallbackPhysicsShape: 1 |
|||
alphaUsage: 1 |
|||
alphaIsTransparency: 0 |
|||
spriteTessellationDetail: -1 |
|||
textureType: 0 |
|||
textureShape: 1 |
|||
singleChannelComponent: 0 |
|||
maxTextureSizeSet: 0 |
|||
compressionQualitySet: 0 |
|||
textureFormatSet: 0 |
|||
platformSettings: |
|||
- serializedVersion: 3 |
|||
buildTarget: DefaultTexturePlatform |
|||
maxTextureSize: 2048 |
|||
resizeAlgorithm: 0 |
|||
textureFormat: -1 |
|||
textureCompression: 1 |
|||
compressionQuality: 50 |
|||
crunchedCompression: 0 |
|||
allowsAlphaSplitting: 0 |
|||
overridden: 0 |
|||
androidETC2FallbackOverride: 0 |
|||
forceMaximumCompressionQuality_BC6H_BC7: 0 |
|||
spriteSheet: |
|||
serializedVersion: 2 |
|||
sprites: [] |
|||
outline: [] |
|||
physicsShape: [] |
|||
bones: [] |
|||
spriteID: |
|||
internalID: 0 |
|||
vertices: [] |
|||
indices: |
|||
edges: [] |
|||
weights: [] |
|||
secondaryTextures: [] |
|||
spritePackingTag: |
|||
pSDRemoveMatte: 0 |
|||
pSDShowRemoveMatteOption: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &-7458053655313033853 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 11 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} |
|||
m_Name: |
|||
m_EditorClassIdentifier: |
|||
version: 1 |
|||
--- !u!21 &2100000 |
|||
Material: |
|||
serializedVersion: 6 |
|||
m_ObjectHideFlags: 0 |
|||
m_CorrespondingSourceObject: {fileID: 0} |
|||
m_PrefabInstance: {fileID: 0} |
|||
m_PrefabAsset: {fileID: 0} |
|||
m_Name: Weapon_Trail_Distortion_Mat |
|||
m_Shader: {fileID: -6465566751694194690, guid: 6f2be88008c45e747b2cbf1018394612, |
|||
type: 3} |
|||
m_ShaderKeywords: |
|||
m_LightmapFlags: 0 |
|||
m_EnableInstancingVariants: 0 |
|||
m_DoubleSidedGI: 0 |
|||
m_CustomRenderQueue: -1 |
|||
stringTagMap: {} |
|||
disabledShaderPasses: [] |
|||
m_SavedProperties: |
|||
serializedVersion: 3 |
|||
m_TexEnvs: |
|||
- Texture2D_9BF9DBFB: |
|||
m_Texture: {fileID: 2800000, guid: ff8d2362415c115408cdcf06000dec66, type: 3} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BaseMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _BumpMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _EmissionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MainTex: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _MetallicGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _OcclusionMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
- _SpecGlossMap: |
|||
m_Texture: {fileID: 0} |
|||
m_Scale: {x: 1, y: 1} |
|||
m_Offset: {x: 0, y: 0} |
|||
m_Floats: |
|||
- Vector1_229C07CC: 2.19 |
|||
- Vector1_5DF01ADF: -0.03 |
|||
- Vector1_90C9BC45: 0.82 |
|||
- Vector1_BDDAF593: 5.04 |
|||
- Vector1_DFC0AA35: 0.63 |
|||
- Vector1_E1EEE93C: 0.71 |
|||
- _AlphaClip: 0 |
|||
- _Blend: 0 |
|||
- _BlendOp: 0 |
|||
- _BumpScale: 1 |
|||
- _CameraFadingEnabled: 0 |
|||
- _CameraFarFadeDistance: 2 |
|||
- _CameraNearFadeDistance: 1 |
|||
- _ColorMode: 0 |
|||
- _Cull: 0 |
|||
- _Cutoff: 0.5 |
|||
- _DistortionBlend: 0.5 |
|||
- _DistortionEnabled: 0 |
|||
- _DistortionStrength: 1 |
|||
- _DistortionStrengthScaled: 0 |
|||
- _DstBlend: 0 |
|||
- _EmissionEnabled: 0 |
|||
- _EnvironmentReflections: 1 |
|||
- _FlipbookMode: 0 |
|||
- _GlossMapScale: 0 |
|||
- _Glossiness: 0 |
|||
- _GlossyReflections: 0 |
|||
- _LightingEnabled: 0 |
|||
- _Metallic: 0 |
|||
- _Mode: 0 |
|||
- _OcclusionStrength: 1 |
|||
- _QueueOffset: 0 |
|||
- _ReceiveShadows: 1 |
|||
- _Smoothness: 0.5 |
|||
- _SmoothnessTextureChannel: 0 |
|||
- _SoftParticlesEnabled: 0 |
|||
- _SoftParticlesFarFadeDistance: 1 |
|||
- _SoftParticlesNearFadeDistance: 0 |
|||
- _SpecularHighlights: 1 |
|||
- _SrcBlend: 1 |
|||
- _Surface: 0 |
|||
- _WorkflowMode: 1 |
|||
- _ZWrite: 1 |
|||
m_Colors: |
|||
- Color_7A3A60E1: {r: 1, g: 0, b: 0, a: 0} |
|||
- _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} |
|||
- _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} |
|||
- _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1} |
|||
- _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} |
|||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1} |
|||
- _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} |
|||
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} |
|
|||
fileFormatVersion: 2 |
|||
guid: 6ddc3ed69fff44c409ff48f83a177748 |
|||
NativeFormatImporter: |
|||
externalObjects: {} |
|||
mainObjectFileID: 0 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEditor; |
|||
using UnityEditorInternal; |
|||
|
|||
[CustomEditor(typeof(DeviceDisplayConfigurator))] |
|||
[CanEditMultipleObjects] |
|||
public class DeviceDisplayConfiguratorEditor : Editor |
|||
{ |
|||
private ReorderableList list2; |
|||
|
|||
public override void OnInspectorGUI() |
|||
{ |
|||
|
|||
this.serializedObject.Update(); |
|||
|
|||
ReorderableListUtility.DoLayoutListWithFoldout(this.list2); |
|||
|
|||
this.serializedObject.ApplyModifiedProperties(); |
|||
} |
|||
|
|||
private void OnEnable() |
|||
{ |
|||
var property = this.serializedObject.FindProperty("deviceSettings"); |
|||
|
|||
this.list2 = ReorderableListUtility.CreateAutoLayout( |
|||
property, |
|||
new string[] { "Raw Path Name", "Display Name", "Display Color" } |
|||
); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 3394780836865e8449248f8ede70a004 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
|
|||
[CreateAssetMenu(fileName = "Device Color Scheme", menuName = "Scriptable Objects/Device Color Scheme", order = 1)] |
|||
public class DeviceColorScheme : ScriptableObject |
|||
{ |
|||
[Header("Desktop")] |
|||
public Color keyboard; |
|||
|
|||
[Header("Console")] |
|||
public Color xboxController; |
|||
public Color playstationController; |
|||
public Color nintendoSwitchController; |
|||
|
|||
[Header("Fallback")] |
|||
public Color fallbackController; |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue