2021-11-21 22:32:29 +08:00
|
|
|
// GENERATED AUTOMATICALLY FROM 'Assets/InputAssets/Player.inputactions'
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine.InputSystem;
|
|
|
|
using UnityEngine.InputSystem.Utilities;
|
|
|
|
|
|
|
|
public class @Player : IInputActionCollection, IDisposable
|
|
|
|
{
|
|
|
|
public InputActionAsset asset { get; }
|
|
|
|
public @Player()
|
|
|
|
{
|
|
|
|
asset = InputActionAsset.FromJson(@"{
|
|
|
|
""name"": ""Player"",
|
|
|
|
""maps"": [
|
|
|
|
{
|
|
|
|
""name"": ""Normal"",
|
|
|
|
""id"": ""bb06cb9c-bdca-4709-b1aa-457d12d70255"",
|
|
|
|
""actions"": [
|
|
|
|
{
|
|
|
|
""name"": ""Move"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""4e75a7bf-f61d-4467-b879-29135d8cd3d0"",
|
|
|
|
""expectedControlType"": ""Button"",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""Jump"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""24250c6f-6747-478e-b81d-935903c236bf"",
|
|
|
|
""expectedControlType"": ""Button"",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """"
|
2021-11-23 00:22:17 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""Wave"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""a8c8071a-3441-4efd-919d-6bf31d7c6e65"",
|
|
|
|
""expectedControlType"": ""Button"",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """"
|
2021-11-23 23:11:53 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""Sickle"",
|
|
|
|
""type"": ""Button"",
|
|
|
|
""id"": ""d92eaf00-7eaf-4292-ae80-6bfff20b5930"",
|
|
|
|
""expectedControlType"": ""Button"",
|
|
|
|
""processors"": """",
|
|
|
|
""interactions"": """"
|
2021-11-21 22:32:29 +08:00
|
|
|
}
|
|
|
|
],
|
|
|
|
""bindings"": [
|
|
|
|
{
|
|
|
|
""name"": ""键盘"",
|
|
|
|
""id"": ""aab0762b-c5b8-4cbf-a345-04491807edd8"",
|
|
|
|
""path"": ""1DAxis"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": true,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""negative"",
|
|
|
|
""id"": ""502ab101-3e1c-47c5-8097-d026396c86bd"",
|
|
|
|
""path"": ""<Keyboard>/a"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": ""Play"",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""positive"",
|
|
|
|
""id"": ""e22fc4aa-94a8-448b-b0d8-94ab256cc513"",
|
|
|
|
""path"": ""<Keyboard>/d"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": ""Play"",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""手柄"",
|
|
|
|
""id"": ""29d79b45-4963-4fe0-8b84-fe2781deb94e"",
|
|
|
|
""path"": ""1DAxis"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": true,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""negative"",
|
|
|
|
""id"": ""9fd08809-1fed-492c-a498-e52c1201c234"",
|
|
|
|
""path"": ""<Gamepad>/leftStick/left"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": ""Play"",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": ""positive"",
|
|
|
|
""id"": ""5581306c-cc74-4e79-ab4e-96385ffb026c"",
|
|
|
|
""path"": ""<Gamepad>/leftStick/right"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": ""Play"",
|
|
|
|
""action"": ""Move"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""52d29d03-d5c1-4c8b-a2d0-222c4691b2e0"",
|
|
|
|
""path"": ""<Gamepad>/buttonSouth"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Jump"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""e5c34c35-2a26-401f-b1d0-5ce3d0eacf41"",
|
|
|
|
""path"": ""<Keyboard>/k"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Jump"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
2021-11-23 00:22:17 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""1dcf7891-85dd-45b2-978c-103548a0da96"",
|
|
|
|
""path"": ""<Gamepad>/buttonWest"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Wave"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""68b1b15c-87ae-4596-87d6-19744a830390"",
|
|
|
|
""path"": ""<Keyboard>/j"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Wave"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
2021-11-23 23:11:53 +08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""e091c2cb-5d64-4c6c-80a8-2c5b3a3e03df"",
|
|
|
|
""path"": ""<Keyboard>/u"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Sickle"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""name"": """",
|
|
|
|
""id"": ""e9e35d09-e599-40ed-b8e5-ab03961ca484"",
|
|
|
|
""path"": ""<Gamepad>/rightTrigger"",
|
|
|
|
""interactions"": """",
|
|
|
|
""processors"": """",
|
|
|
|
""groups"": """",
|
|
|
|
""action"": ""Sickle"",
|
|
|
|
""isComposite"": false,
|
|
|
|
""isPartOfComposite"": false
|
2021-11-21 22:32:29 +08:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
""controlSchemes"": [
|
|
|
|
{
|
|
|
|
""name"": ""Play"",
|
|
|
|
""bindingGroup"": ""Play"",
|
|
|
|
""devices"": [
|
|
|
|
{
|
|
|
|
""devicePath"": ""<Gamepad>"",
|
2021-11-24 23:23:01 +08:00
|
|
|
""isOptional"": true,
|
2021-11-21 22:32:29 +08:00
|
|
|
""isOR"": false
|
|
|
|
},
|
|
|
|
{
|
|
|
|
""devicePath"": ""<Keyboard>"",
|
2021-11-24 23:23:01 +08:00
|
|
|
""isOptional"": false,
|
2021-11-21 22:32:29 +08:00
|
|
|
""isOR"": false
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}");
|
|
|
|
// Normal
|
|
|
|
m_Normal = asset.FindActionMap("Normal", throwIfNotFound: true);
|
|
|
|
m_Normal_Move = m_Normal.FindAction("Move", throwIfNotFound: true);
|
|
|
|
m_Normal_Jump = m_Normal.FindAction("Jump", throwIfNotFound: true);
|
2021-11-23 00:22:17 +08:00
|
|
|
m_Normal_Wave = m_Normal.FindAction("Wave", throwIfNotFound: true);
|
2021-11-23 23:11:53 +08:00
|
|
|
m_Normal_Sickle = m_Normal.FindAction("Sickle", throwIfNotFound: true);
|
2021-11-21 22:32:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Normal
|
|
|
|
private readonly InputActionMap m_Normal;
|
|
|
|
private INormalActions m_NormalActionsCallbackInterface;
|
|
|
|
private readonly InputAction m_Normal_Move;
|
|
|
|
private readonly InputAction m_Normal_Jump;
|
2021-11-23 00:22:17 +08:00
|
|
|
private readonly InputAction m_Normal_Wave;
|
2021-11-23 23:11:53 +08:00
|
|
|
private readonly InputAction m_Normal_Sickle;
|
2021-11-21 22:32:29 +08:00
|
|
|
public struct NormalActions
|
|
|
|
{
|
|
|
|
private @Player m_Wrapper;
|
|
|
|
public NormalActions(@Player wrapper) { m_Wrapper = wrapper; }
|
|
|
|
public InputAction @Move => m_Wrapper.m_Normal_Move;
|
|
|
|
public InputAction @Jump => m_Wrapper.m_Normal_Jump;
|
2021-11-23 00:22:17 +08:00
|
|
|
public InputAction @Wave => m_Wrapper.m_Normal_Wave;
|
2021-11-23 23:11:53 +08:00
|
|
|
public InputAction @Sickle => m_Wrapper.m_Normal_Sickle;
|
2021-11-21 22:32:29 +08:00
|
|
|
public InputActionMap Get() { return m_Wrapper.m_Normal; }
|
|
|
|
public void Enable() { Get().Enable(); }
|
|
|
|
public void Disable() { Get().Disable(); }
|
|
|
|
public bool enabled => Get().enabled;
|
|
|
|
public static implicit operator InputActionMap(NormalActions set) { return set.Get(); }
|
|
|
|
public void SetCallbacks(INormalActions instance)
|
|
|
|
{
|
|
|
|
if (m_Wrapper.m_NormalActionsCallbackInterface != null)
|
|
|
|
{
|
|
|
|
@Move.started -= m_Wrapper.m_NormalActionsCallbackInterface.OnMove;
|
|
|
|
@Move.performed -= m_Wrapper.m_NormalActionsCallbackInterface.OnMove;
|
|
|
|
@Move.canceled -= m_Wrapper.m_NormalActionsCallbackInterface.OnMove;
|
|
|
|
@Jump.started -= m_Wrapper.m_NormalActionsCallbackInterface.OnJump;
|
|
|
|
@Jump.performed -= m_Wrapper.m_NormalActionsCallbackInterface.OnJump;
|
|
|
|
@Jump.canceled -= m_Wrapper.m_NormalActionsCallbackInterface.OnJump;
|
2021-11-23 00:22:17 +08:00
|
|
|
@Wave.started -= m_Wrapper.m_NormalActionsCallbackInterface.OnWave;
|
|
|
|
@Wave.performed -= m_Wrapper.m_NormalActionsCallbackInterface.OnWave;
|
|
|
|
@Wave.canceled -= m_Wrapper.m_NormalActionsCallbackInterface.OnWave;
|
2021-11-23 23:11:53 +08:00
|
|
|
@Sickle.started -= m_Wrapper.m_NormalActionsCallbackInterface.OnSickle;
|
|
|
|
@Sickle.performed -= m_Wrapper.m_NormalActionsCallbackInterface.OnSickle;
|
|
|
|
@Sickle.canceled -= m_Wrapper.m_NormalActionsCallbackInterface.OnSickle;
|
2021-11-21 22:32:29 +08:00
|
|
|
}
|
|
|
|
m_Wrapper.m_NormalActionsCallbackInterface = instance;
|
|
|
|
if (instance != null)
|
|
|
|
{
|
|
|
|
@Move.started += instance.OnMove;
|
|
|
|
@Move.performed += instance.OnMove;
|
|
|
|
@Move.canceled += instance.OnMove;
|
|
|
|
@Jump.started += instance.OnJump;
|
|
|
|
@Jump.performed += instance.OnJump;
|
|
|
|
@Jump.canceled += instance.OnJump;
|
2021-11-23 00:22:17 +08:00
|
|
|
@Wave.started += instance.OnWave;
|
|
|
|
@Wave.performed += instance.OnWave;
|
|
|
|
@Wave.canceled += instance.OnWave;
|
2021-11-23 23:11:53 +08:00
|
|
|
@Sickle.started += instance.OnSickle;
|
|
|
|
@Sickle.performed += instance.OnSickle;
|
|
|
|
@Sickle.canceled += instance.OnSickle;
|
2021-11-21 22:32:29 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public NormalActions @Normal => new NormalActions(this);
|
|
|
|
private int m_PlaySchemeIndex = -1;
|
|
|
|
public InputControlScheme PlayScheme
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
if (m_PlaySchemeIndex == -1) m_PlaySchemeIndex = asset.FindControlSchemeIndex("Play");
|
|
|
|
return asset.controlSchemes[m_PlaySchemeIndex];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public interface INormalActions
|
|
|
|
{
|
|
|
|
void OnMove(InputAction.CallbackContext context);
|
|
|
|
void OnJump(InputAction.CallbackContext context);
|
2021-11-23 00:22:17 +08:00
|
|
|
void OnWave(InputAction.CallbackContext context);
|
2021-11-23 23:11:53 +08:00
|
|
|
void OnSickle(InputAction.CallbackContext context);
|
2021-11-21 22:32:29 +08:00
|
|
|
}
|
|
|
|
}
|