A game about forced loneliness, made by TACStudios
at master 298 lines 11 kB view raw
1//------------------------------------------------------------------------------ 2// <auto-generated> 3// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator 4// version 1.11.2 5// from Assets/Samples/SimpleDemo/SimpleControls.inputactions 6// 7// Changes to this file may cause incorrect behavior and will be lost if 8// the code is regenerated. 9// </auto-generated> 10//------------------------------------------------------------------------------ 11 12using System; 13using System.Collections; 14using System.Collections.Generic; 15using UnityEngine.InputSystem; 16using UnityEngine.InputSystem.Utilities; 17 18public partial class @SimpleControls: IInputActionCollection2, IDisposable 19{ 20 public InputActionAsset asset { get; } 21 public @SimpleControls() 22 { 23 asset = InputActionAsset.FromJson(@"{ 24 ""name"": ""SimpleControls"", 25 ""maps"": [ 26 { 27 ""name"": ""gameplay"", 28 ""id"": ""265c38f5-dd18-4d34-b198-aec58e1627ff"", 29 ""actions"": [ 30 { 31 ""name"": ""fire"", 32 ""type"": ""Button"", 33 ""id"": ""1077f913-a9f9-41b1-acb3-b9ee0adbc744"", 34 ""expectedControlType"": ""Button"", 35 ""processors"": """", 36 ""interactions"": ""Tap,SlowTap"", 37 ""initialStateCheck"": false 38 }, 39 { 40 ""name"": ""move"", 41 ""type"": ""Value"", 42 ""id"": ""50fd2809-3aa3-4a90-988e-1facf6773553"", 43 ""expectedControlType"": ""Vector2"", 44 ""processors"": """", 45 ""interactions"": """", 46 ""initialStateCheck"": true 47 }, 48 { 49 ""name"": ""look"", 50 ""type"": ""Value"", 51 ""id"": ""c60e0974-d140-4597-a40e-9862193067e9"", 52 ""expectedControlType"": ""Vector2"", 53 ""processors"": """", 54 ""interactions"": """", 55 ""initialStateCheck"": true 56 } 57 ], 58 ""bindings"": [ 59 { 60 ""name"": """", 61 ""id"": ""abb776f3-f329-4f7b-bbf8-b577d13be018"", 62 ""path"": ""*/{PrimaryAction}"", 63 ""interactions"": """", 64 ""processors"": """", 65 ""groups"": """", 66 ""action"": ""fire"", 67 ""isComposite"": false, 68 ""isPartOfComposite"": false 69 }, 70 { 71 ""name"": """", 72 ""id"": ""e1b8c4dd-7b3a-4db6-a93a-0889b59b1afc"", 73 ""path"": ""<Gamepad>/leftStick"", 74 ""interactions"": """", 75 ""processors"": """", 76 ""groups"": """", 77 ""action"": ""move"", 78 ""isComposite"": false, 79 ""isPartOfComposite"": false 80 }, 81 { 82 ""name"": ""Dpad"", 83 ""id"": ""cefc16fc-557a-44b0-939f-2ad792876b07"", 84 ""path"": ""Dpad"", 85 ""interactions"": """", 86 ""processors"": """", 87 ""groups"": """", 88 ""action"": ""move"", 89 ""isComposite"": true, 90 ""isPartOfComposite"": false 91 }, 92 { 93 ""name"": ""up"", 94 ""id"": ""07244659-79df-461d-b329-defbe2fbc5f6"", 95 ""path"": ""<Keyboard>/w"", 96 ""interactions"": """", 97 ""processors"": """", 98 ""groups"": """", 99 ""action"": ""move"", 100 ""isComposite"": false, 101 ""isPartOfComposite"": true 102 }, 103 { 104 ""name"": ""down"", 105 ""id"": ""f0ec75cb-f02c-40d2-a33f-1fd6eab2ae0b"", 106 ""path"": ""<Keyboard>/s"", 107 ""interactions"": """", 108 ""processors"": """", 109 ""groups"": """", 110 ""action"": ""move"", 111 ""isComposite"": false, 112 ""isPartOfComposite"": true 113 }, 114 { 115 ""name"": ""left"", 116 ""id"": ""21fe6bfe-4721-4483-9f4a-a0031ade105c"", 117 ""path"": ""<Keyboard>/a"", 118 ""interactions"": """", 119 ""processors"": """", 120 ""groups"": """", 121 ""action"": ""move"", 122 ""isComposite"": false, 123 ""isPartOfComposite"": true 124 }, 125 { 126 ""name"": ""right"", 127 ""id"": ""2dd39746-c75c-4a11-838a-e59eacaf4e0b"", 128 ""path"": ""<Keyboard>/d"", 129 ""interactions"": """", 130 ""processors"": """", 131 ""groups"": """", 132 ""action"": ""move"", 133 ""isComposite"": false, 134 ""isPartOfComposite"": true 135 }, 136 { 137 ""name"": """", 138 ""id"": ""c106d6e6-2780-47ff-b318-396171bd54cc"", 139 ""path"": ""<Gamepad>/rightStick"", 140 ""interactions"": """", 141 ""processors"": """", 142 ""groups"": """", 143 ""action"": ""look"", 144 ""isComposite"": false, 145 ""isPartOfComposite"": false 146 }, 147 { 148 ""name"": """", 149 ""id"": ""578caa03-6827-4797-adfc-a59770c437fe"", 150 ""path"": ""<Pointer>/delta"", 151 ""interactions"": """", 152 ""processors"": ""ScaleVector2(x=2,y=2)"", 153 ""groups"": """", 154 ""action"": ""look"", 155 ""isComposite"": false, 156 ""isPartOfComposite"": false 157 } 158 ] 159 } 160 ], 161 ""controlSchemes"": [] 162}"); 163 // gameplay 164 m_gameplay = asset.FindActionMap("gameplay", throwIfNotFound: true); 165 m_gameplay_fire = m_gameplay.FindAction("fire", throwIfNotFound: true); 166 m_gameplay_move = m_gameplay.FindAction("move", throwIfNotFound: true); 167 m_gameplay_look = m_gameplay.FindAction("look", throwIfNotFound: true); 168 } 169 170 ~@SimpleControls() 171 { 172 UnityEngine.Debug.Assert(!m_gameplay.enabled, "This will cause a leak and performance issues, SimpleControls.gameplay.Disable() has not been called."); 173 } 174 175 public void Dispose() 176 { 177 UnityEngine.Object.Destroy(asset); 178 } 179 180 public InputBinding? bindingMask 181 { 182 get => asset.bindingMask; 183 set => asset.bindingMask = value; 184 } 185 186 public ReadOnlyArray<InputDevice>? devices 187 { 188 get => asset.devices; 189 set => asset.devices = value; 190 } 191 192 public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes; 193 194 public bool Contains(InputAction action) 195 { 196 return asset.Contains(action); 197 } 198 199 public IEnumerator<InputAction> GetEnumerator() 200 { 201 return asset.GetEnumerator(); 202 } 203 204 IEnumerator IEnumerable.GetEnumerator() 205 { 206 return GetEnumerator(); 207 } 208 209 public void Enable() 210 { 211 asset.Enable(); 212 } 213 214 public void Disable() 215 { 216 asset.Disable(); 217 } 218 219 public IEnumerable<InputBinding> bindings => asset.bindings; 220 221 public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false) 222 { 223 return asset.FindAction(actionNameOrId, throwIfNotFound); 224 } 225 226 public int FindBinding(InputBinding bindingMask, out InputAction action) 227 { 228 return asset.FindBinding(bindingMask, out action); 229 } 230 231 // gameplay 232 private readonly InputActionMap m_gameplay; 233 private List<IGameplayActions> m_GameplayActionsCallbackInterfaces = new List<IGameplayActions>(); 234 private readonly InputAction m_gameplay_fire; 235 private readonly InputAction m_gameplay_move; 236 private readonly InputAction m_gameplay_look; 237 public struct GameplayActions 238 { 239 private @SimpleControls m_Wrapper; 240 public GameplayActions(@SimpleControls wrapper) { m_Wrapper = wrapper; } 241 public InputAction @fire => m_Wrapper.m_gameplay_fire; 242 public InputAction @move => m_Wrapper.m_gameplay_move; 243 public InputAction @look => m_Wrapper.m_gameplay_look; 244 public InputActionMap Get() { return m_Wrapper.m_gameplay; } 245 public void Enable() { Get().Enable(); } 246 public void Disable() { Get().Disable(); } 247 public bool enabled => Get().enabled; 248 public static implicit operator InputActionMap(GameplayActions set) { return set.Get(); } 249 public void AddCallbacks(IGameplayActions instance) 250 { 251 if (instance == null || m_Wrapper.m_GameplayActionsCallbackInterfaces.Contains(instance)) return; 252 m_Wrapper.m_GameplayActionsCallbackInterfaces.Add(instance); 253 @fire.started += instance.OnFire; 254 @fire.performed += instance.OnFire; 255 @fire.canceled += instance.OnFire; 256 @move.started += instance.OnMove; 257 @move.performed += instance.OnMove; 258 @move.canceled += instance.OnMove; 259 @look.started += instance.OnLook; 260 @look.performed += instance.OnLook; 261 @look.canceled += instance.OnLook; 262 } 263 264 private void UnregisterCallbacks(IGameplayActions instance) 265 { 266 @fire.started -= instance.OnFire; 267 @fire.performed -= instance.OnFire; 268 @fire.canceled -= instance.OnFire; 269 @move.started -= instance.OnMove; 270 @move.performed -= instance.OnMove; 271 @move.canceled -= instance.OnMove; 272 @look.started -= instance.OnLook; 273 @look.performed -= instance.OnLook; 274 @look.canceled -= instance.OnLook; 275 } 276 277 public void RemoveCallbacks(IGameplayActions instance) 278 { 279 if (m_Wrapper.m_GameplayActionsCallbackInterfaces.Remove(instance)) 280 UnregisterCallbacks(instance); 281 } 282 283 public void SetCallbacks(IGameplayActions instance) 284 { 285 foreach (var item in m_Wrapper.m_GameplayActionsCallbackInterfaces) 286 UnregisterCallbacks(item); 287 m_Wrapper.m_GameplayActionsCallbackInterfaces.Clear(); 288 AddCallbacks(instance); 289 } 290 } 291 public GameplayActions @gameplay => new GameplayActions(this); 292 public interface IGameplayActions 293 { 294 void OnFire(InputAction.CallbackContext context); 295 void OnMove(InputAction.CallbackContext context); 296 void OnLook(InputAction.CallbackContext context); 297 } 298}