2025-10-14 12:39:53 +08:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
// <auto-generated>
|
|
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
|
|
// version 1.11.2
|
|
|
|
// from Assets/Settings/Input/PlayerInputActions.inputactions
|
|
|
|
//
|
|
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
|
|
// the code is regenerated.
|
|
|
|
// </auto-generated>
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine.InputSystem;
|
|
|
|
using UnityEngine.InputSystem.Utilities;
|
|
|
|
|
2025-10-17 15:10:19 +08:00
|
|
|
namespace Script.Gameplay.Input
|
2025-10-14 12:39:53 +08:00
|
|
|
{
|
|
|
|
public partial class @PlayerInputActions: IInputActionCollection2, IDisposable
|
|
|
|
{
|
|
|
|
public InputActionAsset asset { get; }
|
|
|
|
public @PlayerInputActions()
|
|
|
|
{
|
|
|
|
asset = InputActionAsset.FromJson(@"{
|
|
|
|
""name"": ""PlayerInputActions"",
|
|
|
|
""maps"": [
|
|
|
|
{
|
|
|
|
""name"": ""Player"",
|
|
|
|
""id"": ""c76c22e9-2e4a-4535-bf00-ee32c0071ec4"",
|
|
|
|
""actions"": [
|
|
|
|
{
|
|
|
|
""name"": ""Move"",
|
2025-10-15 21:31:13 +08:00
|
|
|
""type"": ""Value"",
|
2025-10-14 12:39:53 +08:00
|
|
|
""id"": ""cba876cd-5594-42ac-a4b0-2f2ed0f0e120"",
|
2025-10-15 21:31:13 +08:00
|
|
|
""expectedControlType"": ""Vector2"",
|
2025-10-14 12:39:53 +08:00
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """",
|
2025-10-15 21:31:13 +08:00
|
|
|
""initialStateCheck"": true
|
2025-10-14 12:39:53 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""Look"",
|
|
|
|
""type"": ""Value"",
|
|
|
|
""id"": ""e288a319-23aa-463c-bd94-e6a00eec4e3b"",
|
|
|
|
""expectedControlType"": ""Vector2"",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """",
|
|
|
|
""initialStateCheck"": true
|
2025-10-15 21:31:13 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""Jump"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""850284f0-b2d8-412c-9970-c1a7256e29de"",
|
|
|
|
""expectedControlType"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """",
|
|
|
|
""initialStateCheck"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""Interact"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""b405cb77-699f-4558-831a-c6c12a5c0300"",
|
|
|
|
""expectedControlType"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """",
|
|
|
|
""initialStateCheck"": false
|
2025-10-17 15:10:19 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""Pause"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""822c2284-94e3-4636-894c-adfe85ac467d"",
|
|
|
|
""expectedControlType"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """",
|
|
|
|
""initialStateCheck"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""SwitchWatchMode"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""73ffcbfd-15ae-4580-99c4-d7d06ff13bb6"",
|
|
|
|
""expectedControlType"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """",
|
|
|
|
""initialStateCheck"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""Edit"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""20a9157a-918b-42f1-80b1-9e014426068e"",
|
|
|
|
""expectedControlType"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """",
|
|
|
|
""initialStateCheck"": false
|
2025-10-14 12:39:53 +08:00
|
|
|
}
|
|
|
|
],
|
|
|
|
""bindings"": [
|
|
|
|
{
|
|
|
|
""name"": """",
|
2025-10-15 21:31:13 +08:00
|
|
|
""id"": ""d7c34f0b-b18e-4498-8d3e-1bdec4cb355d"",
|
|
|
|
""path"": ""<Mouse>/delta"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Look"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""2D Vector"",
|
|
|
|
""id"": ""132c4a80-d02d-43c4-bf7b-8e0ff43a44de"",
|
|
|
|
""path"": ""2DVector"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": true,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""up"",
|
|
|
|
""id"": ""a4d4ec38-2560-46b0-b57b-d9ea0f35d701"",
|
2025-10-14 12:39:53 +08:00
|
|
|
""path"": ""<Keyboard>/w"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": false,
|
2025-10-15 21:31:13 +08:00
|
|
|
""isPartOfComposite"": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""down"",
|
|
|
|
""id"": ""f1c59ea2-0648-4f49-8cfb-d566be529303"",
|
|
|
|
""path"": ""<Keyboard>/s"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""left"",
|
|
|
|
""id"": ""529b3ae4-cbf4-412c-a783-5bf62c57de72"",
|
|
|
|
""path"": ""<Keyboard>/a"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""right"",
|
|
|
|
""id"": ""57ddd6bd-cbf7-4cfb-98d3-5b4458a21562"",
|
|
|
|
""path"": ""<Keyboard>/d"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""b6a61d59-edf3-4759-8791-8967ffa1e187"",
|
|
|
|
""path"": ""<Keyboard>/space"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Jump"",
|
|
|
|
""isComposite"": false,
|
2025-10-14 12:39:53 +08:00
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
2025-10-15 21:31:13 +08:00
|
|
|
""id"": ""c7bb1d3e-20de-4ff9-96fc-bfc70ca54e20"",
|
|
|
|
""path"": ""<Keyboard>/f"",
|
2025-10-14 12:39:53 +08:00
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
2025-10-15 21:31:13 +08:00
|
|
|
""action"": ""Interact"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
2025-10-17 15:10:19 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""943ba523-b024-410e-a250-735a5ffdf786"",
|
|
|
|
""path"": ""<Keyboard>/escape"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Pause"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""47af0242-9835-4b1a-82c8-e3fc32489870"",
|
|
|
|
""path"": ""<Keyboard>/tab"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""SwitchWatchMode"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""9e9bf8ec-8b3e-4230-a10c-ae874395711a"",
|
|
|
|
""path"": ""<Keyboard>/x"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Edit"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
2025-10-14 12:39:53 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
""controlSchemes"": []
|
|
|
|
}");
|
|
|
|
// Player
|
|
|
|
m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
|
|
|
|
m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
|
|
|
|
m_Player_Look = m_Player.FindAction("Look", throwIfNotFound: true);
|
2025-10-15 21:31:13 +08:00
|
|
|
m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true);
|
|
|
|
m_Player_Interact = m_Player.FindAction("Interact", throwIfNotFound: true);
|
2025-10-17 15:10:19 +08:00
|
|
|
m_Player_Pause = m_Player.FindAction("Pause", throwIfNotFound: true);
|
|
|
|
m_Player_SwitchWatchMode = m_Player.FindAction("SwitchWatchMode", throwIfNotFound: true);
|
|
|
|
m_Player_Edit = m_Player.FindAction("Edit", throwIfNotFound: true);
|
2025-10-14 12:39:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
~@PlayerInputActions()
|
|
|
|
{
|
|
|
|
UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, PlayerInputActions.Player.Disable() has not been called.");
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
{
|
|
|
|
UnityEngine.Object.Destroy(asset);
|
|
|
|
}
|
|
|
|
|
|
|
|
public InputBinding? bindingMask
|
|
|
|
{
|
|
|
|
get => asset.bindingMask;
|
|
|
|
set => asset.bindingMask = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ReadOnlyArray<InputDevice>? devices
|
|
|
|
{
|
|
|
|
get => asset.devices;
|
|
|
|
set => asset.devices = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
|
|
|
|
|
|
|
|
public bool Contains(InputAction action)
|
|
|
|
{
|
|
|
|
return asset.Contains(action);
|
|
|
|
}
|
|
|
|
|
|
|
|
public IEnumerator<InputAction> GetEnumerator()
|
|
|
|
{
|
|
|
|
return asset.GetEnumerator();
|
|
|
|
}
|
|
|
|
|
|
|
|
IEnumerator IEnumerable.GetEnumerator()
|
|
|
|
{
|
|
|
|
return GetEnumerator();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Enable()
|
|
|
|
{
|
|
|
|
asset.Enable();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Disable()
|
|
|
|
{
|
|
|
|
asset.Disable();
|
|
|
|
}
|
|
|
|
|
|
|
|
public IEnumerable<InputBinding> bindings => asset.bindings;
|
|
|
|
|
|
|
|
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
|
|
|
|
{
|
|
|
|
return asset.FindAction(actionNameOrId, throwIfNotFound);
|
|
|
|
}
|
|
|
|
|
|
|
|
public int FindBinding(InputBinding bindingMask, out InputAction action)
|
|
|
|
{
|
|
|
|
return asset.FindBinding(bindingMask, out action);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Player
|
|
|
|
private readonly InputActionMap m_Player;
|
|
|
|
private List<IPlayerActions> m_PlayerActionsCallbackInterfaces = new List<IPlayerActions>();
|
|
|
|
private readonly InputAction m_Player_Move;
|
|
|
|
private readonly InputAction m_Player_Look;
|
2025-10-15 21:31:13 +08:00
|
|
|
private readonly InputAction m_Player_Jump;
|
|
|
|
private readonly InputAction m_Player_Interact;
|
2025-10-17 15:10:19 +08:00
|
|
|
private readonly InputAction m_Player_Pause;
|
|
|
|
private readonly InputAction m_Player_SwitchWatchMode;
|
|
|
|
private readonly InputAction m_Player_Edit;
|
2025-10-14 12:39:53 +08:00
|
|
|
public struct PlayerActions
|
|
|
|
{
|
|
|
|
private @PlayerInputActions m_Wrapper;
|
|
|
|
public PlayerActions(@PlayerInputActions wrapper) { m_Wrapper = wrapper; }
|
|
|
|
public InputAction @Move => m_Wrapper.m_Player_Move;
|
|
|
|
public InputAction @Look => m_Wrapper.m_Player_Look;
|
2025-10-15 21:31:13 +08:00
|
|
|
public InputAction @Jump => m_Wrapper.m_Player_Jump;
|
|
|
|
public InputAction @Interact => m_Wrapper.m_Player_Interact;
|
2025-10-17 15:10:19 +08:00
|
|
|
public InputAction @Pause => m_Wrapper.m_Player_Pause;
|
|
|
|
public InputAction @SwitchWatchMode => m_Wrapper.m_Player_SwitchWatchMode;
|
|
|
|
public InputAction @Edit => m_Wrapper.m_Player_Edit;
|
2025-10-14 12:39:53 +08:00
|
|
|
public InputActionMap Get() { return m_Wrapper.m_Player; }
|
|
|
|
public void Enable() { Get().Enable(); }
|
|
|
|
public void Disable() { Get().Disable(); }
|
|
|
|
public bool enabled => Get().enabled;
|
|
|
|
public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); }
|
|
|
|
public void AddCallbacks(IPlayerActions instance)
|
|
|
|
{
|
|
|
|
if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return;
|
|
|
|
m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance);
|
|
|
|
@Move.started += instance.OnMove;
|
|
|
|
@Move.performed += instance.OnMove;
|
|
|
|
@Move.canceled += instance.OnMove;
|
|
|
|
@Look.started += instance.OnLook;
|
|
|
|
@Look.performed += instance.OnLook;
|
|
|
|
@Look.canceled += instance.OnLook;
|
2025-10-15 21:31:13 +08:00
|
|
|
@Jump.started += instance.OnJump;
|
|
|
|
@Jump.performed += instance.OnJump;
|
|
|
|
@Jump.canceled += instance.OnJump;
|
|
|
|
@Interact.started += instance.OnInteract;
|
|
|
|
@Interact.performed += instance.OnInteract;
|
|
|
|
@Interact.canceled += instance.OnInteract;
|
2025-10-17 15:10:19 +08:00
|
|
|
@Pause.started += instance.OnPause;
|
|
|
|
@Pause.performed += instance.OnPause;
|
|
|
|
@Pause.canceled += instance.OnPause;
|
|
|
|
@SwitchWatchMode.started += instance.OnSwitchWatchMode;
|
|
|
|
@SwitchWatchMode.performed += instance.OnSwitchWatchMode;
|
|
|
|
@SwitchWatchMode.canceled += instance.OnSwitchWatchMode;
|
|
|
|
@Edit.started += instance.OnEdit;
|
|
|
|
@Edit.performed += instance.OnEdit;
|
|
|
|
@Edit.canceled += instance.OnEdit;
|
2025-10-14 12:39:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
private void UnregisterCallbacks(IPlayerActions instance)
|
|
|
|
{
|
|
|
|
@Move.started -= instance.OnMove;
|
|
|
|
@Move.performed -= instance.OnMove;
|
|
|
|
@Move.canceled -= instance.OnMove;
|
|
|
|
@Look.started -= instance.OnLook;
|
|
|
|
@Look.performed -= instance.OnLook;
|
|
|
|
@Look.canceled -= instance.OnLook;
|
2025-10-15 21:31:13 +08:00
|
|
|
@Jump.started -= instance.OnJump;
|
|
|
|
@Jump.performed -= instance.OnJump;
|
|
|
|
@Jump.canceled -= instance.OnJump;
|
|
|
|
@Interact.started -= instance.OnInteract;
|
|
|
|
@Interact.performed -= instance.OnInteract;
|
|
|
|
@Interact.canceled -= instance.OnInteract;
|
2025-10-17 15:10:19 +08:00
|
|
|
@Pause.started -= instance.OnPause;
|
|
|
|
@Pause.performed -= instance.OnPause;
|
|
|
|
@Pause.canceled -= instance.OnPause;
|
|
|
|
@SwitchWatchMode.started -= instance.OnSwitchWatchMode;
|
|
|
|
@SwitchWatchMode.performed -= instance.OnSwitchWatchMode;
|
|
|
|
@SwitchWatchMode.canceled -= instance.OnSwitchWatchMode;
|
|
|
|
@Edit.started -= instance.OnEdit;
|
|
|
|
@Edit.performed -= instance.OnEdit;
|
|
|
|
@Edit.canceled -= instance.OnEdit;
|
2025-10-14 12:39:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public void RemoveCallbacks(IPlayerActions instance)
|
|
|
|
{
|
|
|
|
if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance))
|
|
|
|
UnregisterCallbacks(instance);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void SetCallbacks(IPlayerActions instance)
|
|
|
|
{
|
|
|
|
foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces)
|
|
|
|
UnregisterCallbacks(item);
|
|
|
|
m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear();
|
|
|
|
AddCallbacks(instance);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public PlayerActions @Player => new PlayerActions(this);
|
|
|
|
public interface IPlayerActions
|
|
|
|
{
|
|
|
|
void OnMove(InputAction.CallbackContext context);
|
|
|
|
void OnLook(InputAction.CallbackContext context);
|
2025-10-15 21:31:13 +08:00
|
|
|
void OnJump(InputAction.CallbackContext context);
|
|
|
|
void OnInteract(InputAction.CallbackContext context);
|
2025-10-17 15:10:19 +08:00
|
|
|
void OnPause(InputAction.CallbackContext context);
|
|
|
|
void OnSwitchWatchMode(InputAction.CallbackContext context);
|
|
|
|
void OnEdit(InputAction.CallbackContext context);
|
2025-10-14 12:39:53 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|