-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayerControls.cs
152 lines (139 loc) · 5.05 KB
/
PlayerControls.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.4.4
// from Assets/Scripts/Player/Inputs/PlayerControls.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 @PlayerControls : IInputActionCollection2, IDisposable
{
public InputActionAsset asset { get; }
public @PlayerControls()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""PlayerControls"",
""maps"": [
{
""name"": ""PlayerOne"",
""id"": ""26b47c6b-0ba8-4ff2-a6bc-4d9cf1eb9139"",
""actions"": [
{
""name"": ""Move"",
""type"": ""Value"",
""id"": ""8fa33149-80cf-465b-9a81-8329debccc7d"",
""expectedControlType"": ""Stick"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true
}
],
""bindings"": [
{
""name"": """",
""id"": ""641cf158-e38f-4045-b05e-7c32538bd41f"",
""path"": ""<Gamepad>/leftStick"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
],
""controlSchemes"": []
}");
// PlayerOne
m_PlayerOne = asset.FindActionMap("PlayerOne", throwIfNotFound: true);
m_PlayerOne_Move = m_PlayerOne.FindAction("Move", 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);
}
// PlayerOne
private readonly InputActionMap m_PlayerOne;
private IPlayerOneActions m_PlayerOneActionsCallbackInterface;
private readonly InputAction m_PlayerOne_Move;
public struct PlayerOneActions
{
private @PlayerControls m_Wrapper;
public PlayerOneActions(@PlayerControls wrapper) { m_Wrapper = wrapper; }
public InputAction @Move => m_Wrapper.m_PlayerOne_Move;
public InputActionMap Get() { return m_Wrapper.m_PlayerOne; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(PlayerOneActions set) { return set.Get(); }
public void SetCallbacks(IPlayerOneActions instance)
{
if (m_Wrapper.m_PlayerOneActionsCallbackInterface != null)
{
@Move.started -= m_Wrapper.m_PlayerOneActionsCallbackInterface.OnMove;
@Move.performed -= m_Wrapper.m_PlayerOneActionsCallbackInterface.OnMove;
@Move.canceled -= m_Wrapper.m_PlayerOneActionsCallbackInterface.OnMove;
}
m_Wrapper.m_PlayerOneActionsCallbackInterface = instance;
if (instance != null)
{
@Move.started += instance.OnMove;
@Move.performed += instance.OnMove;
@Move.canceled += instance.OnMove;
}
}
}
public PlayerOneActions @PlayerOne => new PlayerOneActions(this);
public interface IPlayerOneActions
{
void OnMove(InputAction.CallbackContext context);
}
}