InGameHintsActions.cs (16352B)
1 // GENERATED AUTOMATICALLY FROM 'Assets/Samples/Input System/1.0.0-preview.6/In-Game Hints/InGameHintsActions.inputactions' 2 3 using System; 4 using System.Collections; 5 using System.Collections.Generic; 6 using UnityEngine.InputSystem; 7 using UnityEngine.InputSystem.Utilities; 8 9 namespace UnityEngine.InputSystem.Samples.InGameHints 10 { 11 public class @InGameHintsActions : IInputActionCollection, IDisposable 12 { 13 public InputActionAsset asset { get; } 14 public @InGameHintsActions() 15 { 16 asset = InputActionAsset.FromJson(@"{ 17 ""name"": ""InGameHintsActions"", 18 ""maps"": [ 19 { 20 ""name"": ""Gameplay"", 21 ""id"": ""9af2d1b0-cc47-4300-854c-838acb4b168b"", 22 ""actions"": [ 23 { 24 ""name"": ""Move"", 25 ""type"": ""Value"", 26 ""id"": ""7e7492e7-1329-48bb-9fdc-279fd15473b4"", 27 ""expectedControlType"": ""Vector2"", 28 ""processors"": """", 29 ""interactions"": """" 30 }, 31 { 32 ""name"": ""Look"", 33 ""type"": ""Value"", 34 ""id"": ""981fecc2-2e7a-4d6a-b041-00b47626e0a1"", 35 ""expectedControlType"": ""Vector2"", 36 ""processors"": """", 37 ""interactions"": """" 38 }, 39 { 40 ""name"": ""PickUp"", 41 ""type"": ""Button"", 42 ""id"": ""5a59bbc2-a3d4-4cbd-88bb-01120d97dc69"", 43 ""expectedControlType"": """", 44 ""processors"": """", 45 ""interactions"": """" 46 }, 47 { 48 ""name"": ""Drop"", 49 ""type"": ""Button"", 50 ""id"": ""f37bbe7e-e241-443f-b868-c784e1219f25"", 51 ""expectedControlType"": """", 52 ""processors"": """", 53 ""interactions"": """" 54 }, 55 { 56 ""name"": ""Throw"", 57 ""type"": ""Button"", 58 ""id"": ""e450d71c-7cc5-4879-afb5-f3ed682d9824"", 59 ""expectedControlType"": """", 60 ""processors"": """", 61 ""interactions"": """" 62 } 63 ], 64 ""bindings"": [ 65 { 66 ""name"": """", 67 ""id"": ""5abc4d20-74bd-4f14-902f-2bd2cf59cc28"", 68 ""path"": ""<Gamepad>/leftStick"", 69 ""interactions"": """", 70 ""processors"": """", 71 ""groups"": ""Gamepad"", 72 ""action"": ""Move"", 73 ""isComposite"": false, 74 ""isPartOfComposite"": false 75 }, 76 { 77 ""name"": ""WASD"", 78 ""id"": ""b16141b1-1611-44db-9576-5a004eb451f2"", 79 ""path"": ""2DVector"", 80 ""interactions"": """", 81 ""processors"": """", 82 ""groups"": ""Keyboard&Mouse"", 83 ""action"": ""Move"", 84 ""isComposite"": true, 85 ""isPartOfComposite"": false 86 }, 87 { 88 ""name"": ""up"", 89 ""id"": ""2b20de3f-1ad8-4b42-b591-595edf60dced"", 90 ""path"": ""<Keyboard>/w"", 91 ""interactions"": """", 92 ""processors"": """", 93 ""groups"": ""Keyboard&Mouse"", 94 ""action"": ""Move"", 95 ""isComposite"": false, 96 ""isPartOfComposite"": true 97 }, 98 { 99 ""name"": ""down"", 100 ""id"": ""2f92eaa9-7f1f-4f42-9682-d105f7c2fc22"", 101 ""path"": ""<Keyboard>/s"", 102 ""interactions"": """", 103 ""processors"": """", 104 ""groups"": ""Keyboard&Mouse"", 105 ""action"": ""Move"", 106 ""isComposite"": false, 107 ""isPartOfComposite"": true 108 }, 109 { 110 ""name"": ""left"", 111 ""id"": ""3ba79a56-c5f8-4999-8203-bef8471f4bd8"", 112 ""path"": ""<Keyboard>/a"", 113 ""interactions"": """", 114 ""processors"": """", 115 ""groups"": ""Keyboard&Mouse"", 116 ""action"": ""Move"", 117 ""isComposite"": false, 118 ""isPartOfComposite"": true 119 }, 120 { 121 ""name"": ""right"", 122 ""id"": ""8d9acfe6-d844-4860-a151-01d6eb0dfb48"", 123 ""path"": ""<Keyboard>/d"", 124 ""interactions"": """", 125 ""processors"": """", 126 ""groups"": ""Keyboard&Mouse"", 127 ""action"": ""Move"", 128 ""isComposite"": false, 129 ""isPartOfComposite"": true 130 }, 131 { 132 ""name"": """", 133 ""id"": ""b69cbeb7-a5bf-4df1-8965-17d944634cef"", 134 ""path"": ""<Gamepad>/rightStick"", 135 ""interactions"": """", 136 ""processors"": """", 137 ""groups"": ""Gamepad"", 138 ""action"": ""Look"", 139 ""isComposite"": false, 140 ""isPartOfComposite"": false 141 }, 142 { 143 ""name"": """", 144 ""id"": ""b2ddefc9-49da-485d-be28-58e3ec3f8080"", 145 ""path"": ""<Mouse>/delta"", 146 ""interactions"": """", 147 ""processors"": """", 148 ""groups"": ""Keyboard&Mouse"", 149 ""action"": ""Look"", 150 ""isComposite"": false, 151 ""isPartOfComposite"": false 152 }, 153 { 154 ""name"": """", 155 ""id"": ""92182492-7b62-47e0-94ad-53d9937d9905"", 156 ""path"": ""<Gamepad>/buttonSouth"", 157 ""interactions"": """", 158 ""processors"": """", 159 ""groups"": ""Gamepad"", 160 ""action"": ""PickUp"", 161 ""isComposite"": false, 162 ""isPartOfComposite"": false 163 }, 164 { 165 ""name"": """", 166 ""id"": ""e20635aa-ffe7-4ed9-8802-96c039d26a8f"", 167 ""path"": ""<Keyboard>/q"", 168 ""interactions"": """", 169 ""processors"": """", 170 ""groups"": ""Keyboard&Mouse"", 171 ""action"": ""PickUp"", 172 ""isComposite"": false, 173 ""isPartOfComposite"": false 174 }, 175 { 176 ""name"": """", 177 ""id"": ""f5571cd9-1166-4ddc-9071-37dc597b1d4e"", 178 ""path"": ""<Gamepad>/buttonEast"", 179 ""interactions"": """", 180 ""processors"": """", 181 ""groups"": ""Gamepad"", 182 ""action"": ""Drop"", 183 ""isComposite"": false, 184 ""isPartOfComposite"": false 185 }, 186 { 187 ""name"": """", 188 ""id"": ""950f549e-ec9c-4d03-aeff-f09ec4031d01"", 189 ""path"": ""<Keyboard>/e"", 190 ""interactions"": """", 191 ""processors"": """", 192 ""groups"": ""Keyboard&Mouse"", 193 ""action"": ""Drop"", 194 ""isComposite"": false, 195 ""isPartOfComposite"": false 196 }, 197 { 198 ""name"": """", 199 ""id"": ""47d1952d-797b-4f5b-986c-654b8e479deb"", 200 ""path"": ""<Gamepad>/buttonSouth"", 201 ""interactions"": """", 202 ""processors"": """", 203 ""groups"": ""Gamepad"", 204 ""action"": ""Throw"", 205 ""isComposite"": false, 206 ""isPartOfComposite"": false 207 }, 208 { 209 ""name"": """", 210 ""id"": ""02e2493d-1eb3-4334-9d25-92f2b5e21399"", 211 ""path"": ""<Keyboard>/space"", 212 ""interactions"": """", 213 ""processors"": """", 214 ""groups"": ""Keyboard&Mouse"", 215 ""action"": ""Throw"", 216 ""isComposite"": false, 217 ""isPartOfComposite"": false 218 } 219 ] 220 } 221 ], 222 ""controlSchemes"": [ 223 { 224 ""name"": ""Gamepad"", 225 ""bindingGroup"": ""Gamepad"", 226 ""devices"": [ 227 { 228 ""devicePath"": ""<Gamepad>"", 229 ""isOptional"": false, 230 ""isOR"": false 231 } 232 ] 233 }, 234 { 235 ""name"": ""Keyboard&Mouse"", 236 ""bindingGroup"": ""Keyboard&Mouse"", 237 ""devices"": [ 238 { 239 ""devicePath"": ""<Keyboard>"", 240 ""isOptional"": false, 241 ""isOR"": false 242 }, 243 { 244 ""devicePath"": ""<Mouse>"", 245 ""isOptional"": false, 246 ""isOR"": false 247 } 248 ] 249 } 250 ] 251 }"); 252 // Gameplay 253 m_Gameplay = asset.FindActionMap("Gameplay", throwIfNotFound: true); 254 m_Gameplay_Move = m_Gameplay.FindAction("Move", throwIfNotFound: true); 255 m_Gameplay_Look = m_Gameplay.FindAction("Look", throwIfNotFound: true); 256 m_Gameplay_PickUp = m_Gameplay.FindAction("PickUp", throwIfNotFound: true); 257 m_Gameplay_Drop = m_Gameplay.FindAction("Drop", throwIfNotFound: true); 258 m_Gameplay_Throw = m_Gameplay.FindAction("Throw", throwIfNotFound: true); 259 } 260 261 public void Dispose() 262 { 263 UnityEngine.Object.Destroy(asset); 264 } 265 266 public InputBinding? bindingMask 267 { 268 get => asset.bindingMask; 269 set => asset.bindingMask = value; 270 } 271 272 public ReadOnlyArray<InputDevice>? devices 273 { 274 get => asset.devices; 275 set => asset.devices = value; 276 } 277 278 public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes; 279 280 public bool Contains(InputAction action) 281 { 282 return asset.Contains(action); 283 } 284 285 public IEnumerator<InputAction> GetEnumerator() 286 { 287 return asset.GetEnumerator(); 288 } 289 290 IEnumerator IEnumerable.GetEnumerator() 291 { 292 return GetEnumerator(); 293 } 294 295 public void Enable() 296 { 297 asset.Enable(); 298 } 299 300 public void Disable() 301 { 302 asset.Disable(); 303 } 304 305 // Gameplay 306 private readonly InputActionMap m_Gameplay; 307 private IGameplayActions m_GameplayActionsCallbackInterface; 308 private readonly InputAction m_Gameplay_Move; 309 private readonly InputAction m_Gameplay_Look; 310 private readonly InputAction m_Gameplay_PickUp; 311 private readonly InputAction m_Gameplay_Drop; 312 private readonly InputAction m_Gameplay_Throw; 313 public struct GameplayActions 314 { 315 private @InGameHintsActions m_Wrapper; 316 public GameplayActions(@InGameHintsActions wrapper) { m_Wrapper = wrapper; } 317 public InputAction @Move => m_Wrapper.m_Gameplay_Move; 318 public InputAction @Look => m_Wrapper.m_Gameplay_Look; 319 public InputAction @PickUp => m_Wrapper.m_Gameplay_PickUp; 320 public InputAction @Drop => m_Wrapper.m_Gameplay_Drop; 321 public InputAction @Throw => m_Wrapper.m_Gameplay_Throw; 322 public InputActionMap Get() { return m_Wrapper.m_Gameplay; } 323 public void Enable() { Get().Enable(); } 324 public void Disable() { Get().Disable(); } 325 public bool enabled => Get().enabled; 326 public static implicit operator InputActionMap(GameplayActions set) { return set.Get(); } 327 public void SetCallbacks(IGameplayActions instance) 328 { 329 if (m_Wrapper.m_GameplayActionsCallbackInterface != null) 330 { 331 @Move.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove; 332 @Move.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove; 333 @Move.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnMove; 334 @Look.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook; 335 @Look.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook; 336 @Look.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook; 337 @PickUp.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPickUp; 338 @PickUp.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPickUp; 339 @PickUp.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnPickUp; 340 @Drop.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnDrop; 341 @Drop.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnDrop; 342 @Drop.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnDrop; 343 @Throw.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnThrow; 344 @Throw.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnThrow; 345 @Throw.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnThrow; 346 } 347 m_Wrapper.m_GameplayActionsCallbackInterface = instance; 348 if (instance != null) 349 { 350 @Move.started += instance.OnMove; 351 @Move.performed += instance.OnMove; 352 @Move.canceled += instance.OnMove; 353 @Look.started += instance.OnLook; 354 @Look.performed += instance.OnLook; 355 @Look.canceled += instance.OnLook; 356 @PickUp.started += instance.OnPickUp; 357 @PickUp.performed += instance.OnPickUp; 358 @PickUp.canceled += instance.OnPickUp; 359 @Drop.started += instance.OnDrop; 360 @Drop.performed += instance.OnDrop; 361 @Drop.canceled += instance.OnDrop; 362 @Throw.started += instance.OnThrow; 363 @Throw.performed += instance.OnThrow; 364 @Throw.canceled += instance.OnThrow; 365 } 366 } 367 } 368 public GameplayActions @Gameplay => new GameplayActions(this); 369 private int m_GamepadSchemeIndex = -1; 370 public InputControlScheme GamepadScheme 371 { 372 get 373 { 374 if (m_GamepadSchemeIndex == -1) m_GamepadSchemeIndex = asset.FindControlSchemeIndex("Gamepad"); 375 return asset.controlSchemes[m_GamepadSchemeIndex]; 376 } 377 } 378 private int m_KeyboardMouseSchemeIndex = -1; 379 public InputControlScheme KeyboardMouseScheme 380 { 381 get 382 { 383 if (m_KeyboardMouseSchemeIndex == -1) m_KeyboardMouseSchemeIndex = asset.FindControlSchemeIndex("Keyboard&Mouse"); 384 return asset.controlSchemes[m_KeyboardMouseSchemeIndex]; 385 } 386 } 387 public interface IGameplayActions 388 { 389 void OnMove(InputAction.CallbackContext context); 390 void OnLook(InputAction.CallbackContext context); 391 void OnPickUp(InputAction.CallbackContext context); 392 void OnDrop(InputAction.CallbackContext context); 393 void OnThrow(InputAction.CallbackContext context); 394 } 395 } 396 }