1
This commit is contained in:
523
unity/Assets/Script/Utils/InputActions.cs
Normal file
523
unity/Assets/Script/Utils/InputActions.cs
Normal file
@@ -0,0 +1,523 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
||||
// version 1.4.4
|
||||
// from Assets/Shader/Setting/InputActions.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;
|
||||
|
||||
public partial class @InputActions : IInputActionCollection2, IDisposable
|
||||
{
|
||||
public InputActionAsset asset { get; }
|
||||
public @InputActions()
|
||||
{
|
||||
asset = InputActionAsset.FromJson(@"{
|
||||
""name"": ""InputActions"",
|
||||
""maps"": [
|
||||
{
|
||||
""name"": ""GamePlay"",
|
||||
""id"": ""ef6d65da-b091-4f70-9e32-99c29000e209"",
|
||||
""actions"": [
|
||||
{
|
||||
""name"": ""Move"",
|
||||
""type"": ""Value"",
|
||||
""id"": ""b6a973e9-b6eb-4dad-8a96-553ea339b051"",
|
||||
""expectedControlType"": ""Vector2"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": true
|
||||
},
|
||||
{
|
||||
""name"": ""Dodge"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""d348f7e8-ff62-4c96-87c1-a9e98d57bb2c"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
""name"": ""ComBa_01"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""9af8087e-ae18-4038-a763-7a50f8a8bdb0"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
""name"": ""ComBa_02"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""3f62d770-4603-4cf6-abef-09404d6f9ae5"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
}
|
||||
],
|
||||
""bindings"": [
|
||||
{
|
||||
""name"": ""ASWD"",
|
||||
""id"": ""484f54ae-3627-44d2-a373-6a5b54938842"",
|
||||
""path"": ""2DVector"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": true,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": ""up"",
|
||||
""id"": ""ad2dff40-9527-4d45-9c3e-02332a3f51a3"",
|
||||
""path"": ""<Keyboard>/w"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": true
|
||||
},
|
||||
{
|
||||
""name"": ""down"",
|
||||
""id"": ""d08e425e-ae6a-4657-af75-09e68b3ed25c"",
|
||||
""path"": ""<Keyboard>/s"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": true
|
||||
},
|
||||
{
|
||||
""name"": ""left"",
|
||||
""id"": ""4e4b0eaf-ad07-4d76-9daa-935adece5343"",
|
||||
""path"": ""<Keyboard>/a"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": true
|
||||
},
|
||||
{
|
||||
""name"": ""right"",
|
||||
""id"": ""9b1a005b-e37d-4bb0-819d-0f6b89836782"",
|
||||
""path"": ""<Keyboard>/d"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": true
|
||||
},
|
||||
{
|
||||
""name"": ""Arrow"",
|
||||
""id"": ""8d4ef714-11b2-43c3-bbaa-479b49948e0a"",
|
||||
""path"": ""2DVector"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": true,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": ""up"",
|
||||
""id"": ""5b52bfc2-45b5-4de6-915e-b06c67c37f75"",
|
||||
""path"": ""<Keyboard>/upArrow"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": true
|
||||
},
|
||||
{
|
||||
""name"": ""down"",
|
||||
""id"": ""edf2eecb-163f-43bf-bc30-f960e22f3b26"",
|
||||
""path"": ""<Keyboard>/downArrow"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": true
|
||||
},
|
||||
{
|
||||
""name"": ""left"",
|
||||
""id"": ""2ce71c6c-6860-4836-82be-bff71a0c46a2"",
|
||||
""path"": ""<Keyboard>/leftArrow"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": true
|
||||
},
|
||||
{
|
||||
""name"": ""right"",
|
||||
""id"": ""656a945c-89ae-40e7-a605-1e92fbfface0"",
|
||||
""path"": ""<Keyboard>/rightArrow"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": true
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""b48d83b6-1bf3-4ab6-9d2d-20106caf4da6"",
|
||||
""path"": ""<Gamepad>/leftStick"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""Gamepad"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""d23564b4-a3cb-4ea3-a16f-89a230fd21b1"",
|
||||
""path"": ""<Gamepad>/dpad"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""Gamepad"",
|
||||
""action"": ""Move"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""0b5373f5-5766-44bd-ad30-6ecdb7f10507"",
|
||||
""path"": ""<Keyboard>/leftShift"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Dodge"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""8394600a-cbc2-48f3-98f6-e85b97c6c73a"",
|
||||
""path"": ""<Gamepad>/buttonWest"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Dodge"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""7b23266c-b664-4e2f-974f-0a39631edfc8"",
|
||||
""path"": ""<Mouse>/leftButton"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""ComBa_01"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""b722d7d7-f0b4-48ed-9841-38e1b82bc799"",
|
||||
""path"": ""<Gamepad>/buttonNorth"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""Gamepad"",
|
||||
""action"": ""ComBa_01"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""12f4c305-e962-40b4-a9a7-e5aa3da6c393"",
|
||||
""path"": ""<Mouse>/rightButton"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""ComBa_02"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
""name"": ""UI"",
|
||||
""id"": ""c4fb9ed3-1627-423d-846c-d579fa919ec3"",
|
||||
""actions"": [
|
||||
{
|
||||
""name"": ""Stop"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""71b6b5b4-6945-48e1-9fd8-6ed8da0a732d"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
},
|
||||
{
|
||||
""name"": ""Bag"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""190885c1-dabe-4806-9cab-05bb726a1922"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
}
|
||||
],
|
||||
""bindings"": [
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""b0baa221-5e25-4812-8392-536934b794ff"",
|
||||
""path"": ""<Keyboard>/escape"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""PC"",
|
||||
""action"": ""Stop"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""907c233f-767d-4184-9500-025c302482d4"",
|
||||
""path"": ""<Gamepad>/leftStickPress"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": ""Gamepad"",
|
||||
""action"": ""Stop"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""e4beee93-8dbc-4c17-95b7-1f424ff637ac"",
|
||||
""path"": ""<Keyboard>/tab"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Bag"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
""controlSchemes"": [
|
||||
{
|
||||
""name"": ""PC"",
|
||||
""bindingGroup"": ""PC"",
|
||||
""devices"": []
|
||||
},
|
||||
{
|
||||
""name"": ""Gamepad"",
|
||||
""bindingGroup"": ""Gamepad"",
|
||||
""devices"": []
|
||||
}
|
||||
]
|
||||
}");
|
||||
// GamePlay
|
||||
m_GamePlay = asset.FindActionMap("GamePlay", throwIfNotFound: true);
|
||||
m_GamePlay_Move = m_GamePlay.FindAction("Move", throwIfNotFound: true);
|
||||
m_GamePlay_Dodge = m_GamePlay.FindAction("Dodge", throwIfNotFound: true);
|
||||
m_GamePlay_ComBa_01 = m_GamePlay.FindAction("ComBa_01", throwIfNotFound: true);
|
||||
m_GamePlay_ComBa_02 = m_GamePlay.FindAction("ComBa_02", throwIfNotFound: true);
|
||||
// UI
|
||||
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
|
||||
m_UI_Stop = m_UI.FindAction("Stop", throwIfNotFound: true);
|
||||
m_UI_Bag = m_UI.FindAction("Bag", throwIfNotFound: true);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
// GamePlay
|
||||
private readonly InputActionMap m_GamePlay;
|
||||
private IGamePlayActions m_GamePlayActionsCallbackInterface;
|
||||
private readonly InputAction m_GamePlay_Move;
|
||||
private readonly InputAction m_GamePlay_Dodge;
|
||||
private readonly InputAction m_GamePlay_ComBa_01;
|
||||
private readonly InputAction m_GamePlay_ComBa_02;
|
||||
public struct GamePlayActions
|
||||
{
|
||||
private @InputActions m_Wrapper;
|
||||
public GamePlayActions(@InputActions wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @Move => m_Wrapper.m_GamePlay_Move;
|
||||
public InputAction @Dodge => m_Wrapper.m_GamePlay_Dodge;
|
||||
public InputAction @ComBa_01 => m_Wrapper.m_GamePlay_ComBa_01;
|
||||
public InputAction @ComBa_02 => m_Wrapper.m_GamePlay_ComBa_02;
|
||||
public InputActionMap Get() { return m_Wrapper.m_GamePlay; }
|
||||
public void Enable() { Get().Enable(); }
|
||||
public void Disable() { Get().Disable(); }
|
||||
public bool enabled => Get().enabled;
|
||||
public static implicit operator InputActionMap(GamePlayActions set) { return set.Get(); }
|
||||
public void SetCallbacks(IGamePlayActions instance)
|
||||
{
|
||||
if (m_Wrapper.m_GamePlayActionsCallbackInterface != null)
|
||||
{
|
||||
@Move.started -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnMove;
|
||||
@Move.performed -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnMove;
|
||||
@Move.canceled -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnMove;
|
||||
@Dodge.started -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnDodge;
|
||||
@Dodge.performed -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnDodge;
|
||||
@Dodge.canceled -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnDodge;
|
||||
@ComBa_01.started -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnComBa_01;
|
||||
@ComBa_01.performed -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnComBa_01;
|
||||
@ComBa_01.canceled -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnComBa_01;
|
||||
@ComBa_02.started -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnComBa_02;
|
||||
@ComBa_02.performed -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnComBa_02;
|
||||
@ComBa_02.canceled -= m_Wrapper.m_GamePlayActionsCallbackInterface.OnComBa_02;
|
||||
}
|
||||
m_Wrapper.m_GamePlayActionsCallbackInterface = instance;
|
||||
if (instance != null)
|
||||
{
|
||||
@Move.started += instance.OnMove;
|
||||
@Move.performed += instance.OnMove;
|
||||
@Move.canceled += instance.OnMove;
|
||||
@Dodge.started += instance.OnDodge;
|
||||
@Dodge.performed += instance.OnDodge;
|
||||
@Dodge.canceled += instance.OnDodge;
|
||||
@ComBa_01.started += instance.OnComBa_01;
|
||||
@ComBa_01.performed += instance.OnComBa_01;
|
||||
@ComBa_01.canceled += instance.OnComBa_01;
|
||||
@ComBa_02.started += instance.OnComBa_02;
|
||||
@ComBa_02.performed += instance.OnComBa_02;
|
||||
@ComBa_02.canceled += instance.OnComBa_02;
|
||||
}
|
||||
}
|
||||
}
|
||||
public GamePlayActions @GamePlay => new GamePlayActions(this);
|
||||
|
||||
// UI
|
||||
private readonly InputActionMap m_UI;
|
||||
private IUIActions m_UIActionsCallbackInterface;
|
||||
private readonly InputAction m_UI_Stop;
|
||||
private readonly InputAction m_UI_Bag;
|
||||
public struct UIActions
|
||||
{
|
||||
private @InputActions m_Wrapper;
|
||||
public UIActions(@InputActions wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @Stop => m_Wrapper.m_UI_Stop;
|
||||
public InputAction @Bag => m_Wrapper.m_UI_Bag;
|
||||
public InputActionMap Get() { return m_Wrapper.m_UI; }
|
||||
public void Enable() { Get().Enable(); }
|
||||
public void Disable() { Get().Disable(); }
|
||||
public bool enabled => Get().enabled;
|
||||
public static implicit operator InputActionMap(UIActions set) { return set.Get(); }
|
||||
public void SetCallbacks(IUIActions instance)
|
||||
{
|
||||
if (m_Wrapper.m_UIActionsCallbackInterface != null)
|
||||
{
|
||||
@Stop.started -= m_Wrapper.m_UIActionsCallbackInterface.OnStop;
|
||||
@Stop.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnStop;
|
||||
@Stop.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnStop;
|
||||
@Bag.started -= m_Wrapper.m_UIActionsCallbackInterface.OnBag;
|
||||
@Bag.performed -= m_Wrapper.m_UIActionsCallbackInterface.OnBag;
|
||||
@Bag.canceled -= m_Wrapper.m_UIActionsCallbackInterface.OnBag;
|
||||
}
|
||||
m_Wrapper.m_UIActionsCallbackInterface = instance;
|
||||
if (instance != null)
|
||||
{
|
||||
@Stop.started += instance.OnStop;
|
||||
@Stop.performed += instance.OnStop;
|
||||
@Stop.canceled += instance.OnStop;
|
||||
@Bag.started += instance.OnBag;
|
||||
@Bag.performed += instance.OnBag;
|
||||
@Bag.canceled += instance.OnBag;
|
||||
}
|
||||
}
|
||||
}
|
||||
public UIActions @UI => new UIActions(this);
|
||||
private int m_PCSchemeIndex = -1;
|
||||
public InputControlScheme PCScheme
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_PCSchemeIndex == -1) m_PCSchemeIndex = asset.FindControlSchemeIndex("PC");
|
||||
return asset.controlSchemes[m_PCSchemeIndex];
|
||||
}
|
||||
}
|
||||
private int m_GamepadSchemeIndex = -1;
|
||||
public InputControlScheme GamepadScheme
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_GamepadSchemeIndex == -1) m_GamepadSchemeIndex = asset.FindControlSchemeIndex("Gamepad");
|
||||
return asset.controlSchemes[m_GamepadSchemeIndex];
|
||||
}
|
||||
}
|
||||
public interface IGamePlayActions
|
||||
{
|
||||
void OnMove(InputAction.CallbackContext context);
|
||||
void OnDodge(InputAction.CallbackContext context);
|
||||
void OnComBa_01(InputAction.CallbackContext context);
|
||||
void OnComBa_02(InputAction.CallbackContext context);
|
||||
}
|
||||
public interface IUIActions
|
||||
{
|
||||
void OnStop(InputAction.CallbackContext context);
|
||||
void OnBag(InputAction.CallbackContext context);
|
||||
}
|
||||
}
|
||||
11
unity/Assets/Script/Utils/InputActions.cs.meta
Normal file
11
unity/Assets/Script/Utils/InputActions.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 94cf862b15dc4df40966b28f96776336
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user