From 3af4c218c0e70167db23a6303d2af30aff37d2fe Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 20 Aug 2020 23:40:50 -0400 Subject: Removed a bunch of stuff; Changes --- Assets/Input/PlayerControls.cs | 390 ++++++++++++++++++++++++++ Assets/Input/PlayerControls.cs.meta | 11 + Assets/Input/PlayerControls.inputactions | 253 +++++++++++++++++ Assets/Input/PlayerControls.inputactions.meta | 14 + Assets/Input/README.txt | 1 + Assets/Input/README.txt.meta | 7 + 6 files changed, 676 insertions(+) create mode 100644 Assets/Input/PlayerControls.cs create mode 100644 Assets/Input/PlayerControls.cs.meta create mode 100644 Assets/Input/PlayerControls.inputactions create mode 100644 Assets/Input/PlayerControls.inputactions.meta create mode 100644 Assets/Input/README.txt create mode 100644 Assets/Input/README.txt.meta (limited to 'Assets/Input') diff --git a/Assets/Input/PlayerControls.cs b/Assets/Input/PlayerControls.cs new file mode 100644 index 0000000..9a30182 --- /dev/null +++ b/Assets/Input/PlayerControls.cs @@ -0,0 +1,390 @@ +// GENERATED AUTOMATICALLY FROM 'Assets/Input/PlayerControls.inputactions' + +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine.InputSystem; +using UnityEngine.InputSystem.Utilities; + +public class @PlayerControls : IInputActionCollection, IDisposable +{ + public InputActionAsset asset { get; } + public @PlayerControls() + { + asset = InputActionAsset.FromJson(@"{ + ""name"": ""PlayerControls"", + ""maps"": [ + { + ""name"": ""Gameplay"", + ""id"": ""5d541da2-8407-491f-a554-34eed5683cbf"", + ""actions"": [ + { + ""name"": ""Move"", + ""type"": ""PassThrough"", + ""id"": ""176b5378-76bb-4a9a-b220-0cf716e618ce"", + ""expectedControlType"": """", + ""processors"": """", + ""interactions"": """" + }, + { + ""name"": ""Jump"", + ""type"": ""Button"", + ""id"": ""0e4d534b-a725-4b9c-80ad-a657cec04a8a"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """" + }, + { + ""name"": ""Look"", + ""type"": ""Button"", + ""id"": ""1769d1d9-6996-4cac-8248-19ddf9ffa46e"", + ""expectedControlType"": ""Button"", + ""processors"": """", + ""interactions"": """" + } + ], + ""bindings"": [ + { + ""name"": ""WASD"", + ""id"": ""af1c1446-133f-4220-8718-ac63313ce010"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Move"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""f1720972-4a04-4bcf-b96f-fe0845ed9ed2"", + ""path"": ""/w"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard and Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""43e9776a-fcae-48fd-9ed5-af1b0745f82b"", + ""path"": ""/s"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard and Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""08b284f6-a56f-4584-894b-d26470ce5d03"", + ""path"": ""/a"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard and Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""5a94bfd0-5ef4-4bad-a7e5-10330c4e50fd"", + ""path"": ""/d"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard and Mouse"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""Left Stick"", + ""id"": ""88171fd5-c7ad-4669-b31a-59c734a98f77"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Move"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""a07fde90-0b40-42a9-96f3-df7896f30223"", + ""path"": ""/leftStick/up"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""01beeb9f-62e7-4ea1-bf4d-9e6c9b2226df"", + ""path"": ""/leftStick/down"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""c8ea7a39-dbfa-4614-ab6f-60d9b3bcb786"", + ""path"": ""/leftStick/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""05c62b9e-e87b-4f7b-b200-257fc9593d48"", + ""path"": ""/leftStick/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Move"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": """", + ""id"": ""a67cf1da-5e2a-4878-b452-e7372daab939"", + ""path"": ""/space"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Keyboard and Mouse"", + ""action"": ""Jump"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": """", + ""id"": ""debcc072-c2da-4503-b511-9ab019e55e1a"", + ""path"": ""/buttonEast"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Jump"", + ""isComposite"": false, + ""isPartOfComposite"": false + }, + { + ""name"": ""Right Stick"", + ""id"": ""35ad6eba-4737-4f44-a5b3-d6709bfaf303"", + ""path"": ""2DVector"", + ""interactions"": """", + ""processors"": """", + ""groups"": """", + ""action"": ""Look"", + ""isComposite"": true, + ""isPartOfComposite"": false + }, + { + ""name"": ""up"", + ""id"": ""189a746a-e4c6-4b4a-b9cc-de06067eb341"", + ""path"": ""/rightStick/up"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Look"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""down"", + ""id"": ""c8952c61-21f1-4d54-9314-26a9c5338aa5"", + ""path"": ""/rightStick/down"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Look"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""left"", + ""id"": ""aa0a5e3c-6e1d-4cda-a875-39e369d699ee"", + ""path"": ""/rightStick/left"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Look"", + ""isComposite"": false, + ""isPartOfComposite"": true + }, + { + ""name"": ""right"", + ""id"": ""fd3d2415-15f2-488d-b055-365ee2afc166"", + ""path"": ""/rightStick/right"", + ""interactions"": """", + ""processors"": """", + ""groups"": ""Gamepad"", + ""action"": ""Look"", + ""isComposite"": false, + ""isPartOfComposite"": true + } + ] + } + ], + ""controlSchemes"": [ + { + ""name"": ""Keyboard and Mouse"", + ""bindingGroup"": ""Keyboard and Mouse"", + ""devices"": [ + { + ""devicePath"": """", + ""isOptional"": false, + ""isOR"": false + }, + { + ""devicePath"": """", + ""isOptional"": false, + ""isOR"": false + } + ] + }, + { + ""name"": ""Gamepad"", + ""bindingGroup"": ""Gamepad"", + ""devices"": [ + { + ""devicePath"": """", + ""isOptional"": false, + ""isOR"": false + } + ] + } + ] +}"); + // Gameplay + m_Gameplay = asset.FindActionMap("Gameplay", throwIfNotFound: true); + m_Gameplay_Move = m_Gameplay.FindAction("Move", throwIfNotFound: true); + m_Gameplay_Jump = m_Gameplay.FindAction("Jump", throwIfNotFound: true); + m_Gameplay_Look = m_Gameplay.FindAction("Look", throwIfNotFound: true); + } + + public void Dispose() + { + UnityEngine.Object.Destroy(asset); + } + + public InputBinding? bindingMask + { + get => asset.bindingMask; + set => asset.bindingMask = value; + } + + public ReadOnlyArray? devices + { + get => asset.devices; + set => asset.devices = value; + } + + public ReadOnlyArray controlSchemes => asset.controlSchemes; + + public bool Contains(InputAction action) + { + return asset.Contains(action); + } + + public IEnumerator GetEnumerator() + { + return asset.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Enable() + { + asset.Enable(); + } + + public void Disable() + { + asset.Disable(); + } + + // Gameplay + private readonly InputActionMap m_Gameplay; + private IGameplayActions m_GameplayActionsCallbackInterface; + private readonly InputAction m_Gameplay_Move; + private readonly InputAction m_Gameplay_Jump; + private readonly InputAction m_Gameplay_Look; + public struct GameplayActions + { + private @PlayerControls m_Wrapper; + public GameplayActions(@PlayerControls wrapper) { m_Wrapper = wrapper; } + public InputAction @Move => m_Wrapper.m_Gameplay_Move; + public InputAction @Jump => m_Wrapper.m_Gameplay_Jump; + public InputAction @Look => m_Wrapper.m_Gameplay_Look; + 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; + @Jump.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump; + @Jump.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump; + @Jump.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnJump; + @Look.started -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook; + @Look.performed -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook; + @Look.canceled -= m_Wrapper.m_GameplayActionsCallbackInterface.OnLook; + } + m_Wrapper.m_GameplayActionsCallbackInterface = 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; + @Look.started += instance.OnLook; + @Look.performed += instance.OnLook; + @Look.canceled += instance.OnLook; + } + } + } + public GameplayActions @Gameplay => new GameplayActions(this); + private int m_KeyboardandMouseSchemeIndex = -1; + public InputControlScheme KeyboardandMouseScheme + { + get + { + if (m_KeyboardandMouseSchemeIndex == -1) m_KeyboardandMouseSchemeIndex = asset.FindControlSchemeIndex("Keyboard and Mouse"); + return asset.controlSchemes[m_KeyboardandMouseSchemeIndex]; + } + } + 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 OnJump(InputAction.CallbackContext context); + void OnLook(InputAction.CallbackContext context); + } +} diff --git a/Assets/Input/PlayerControls.cs.meta b/Assets/Input/PlayerControls.cs.meta new file mode 100644 index 0000000..4459188 --- /dev/null +++ b/Assets/Input/PlayerControls.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d963c3f6016f63102beea4bef6e5a76d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Input/PlayerControls.inputactions b/Assets/Input/PlayerControls.inputactions new file mode 100644 index 0000000..ed52073 --- /dev/null +++ b/Assets/Input/PlayerControls.inputactions @@ -0,0 +1,253 @@ +{ + "name": "PlayerControls", + "maps": [ + { + "name": "Gameplay", + "id": "5d541da2-8407-491f-a554-34eed5683cbf", + "actions": [ + { + "name": "Move", + "type": "PassThrough", + "id": "176b5378-76bb-4a9a-b220-0cf716e618ce", + "expectedControlType": "", + "processors": "", + "interactions": "" + }, + { + "name": "Jump", + "type": "Button", + "id": "0e4d534b-a725-4b9c-80ad-a657cec04a8a", + "expectedControlType": "Button", + "processors": "", + "interactions": "" + }, + { + "name": "Look", + "type": "Button", + "id": "1769d1d9-6996-4cac-8248-19ddf9ffa46e", + "expectedControlType": "Button", + "processors": "", + "interactions": "" + } + ], + "bindings": [ + { + "name": "WASD", + "id": "af1c1446-133f-4220-8718-ac63313ce010", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "f1720972-4a04-4bcf-b96f-fe0845ed9ed2", + "path": "/w", + "interactions": "", + "processors": "", + "groups": "Keyboard and Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "43e9776a-fcae-48fd-9ed5-af1b0745f82b", + "path": "/s", + "interactions": "", + "processors": "", + "groups": "Keyboard and Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "08b284f6-a56f-4584-894b-d26470ce5d03", + "path": "/a", + "interactions": "", + "processors": "", + "groups": "Keyboard and Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "5a94bfd0-5ef4-4bad-a7e5-10330c4e50fd", + "path": "/d", + "interactions": "", + "processors": "", + "groups": "Keyboard and Mouse", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "Left Stick", + "id": "88171fd5-c7ad-4669-b31a-59c734a98f77", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "a07fde90-0b40-42a9-96f3-df7896f30223", + "path": "/leftStick/up", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "01beeb9f-62e7-4ea1-bf4d-9e6c9b2226df", + "path": "/leftStick/down", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "c8ea7a39-dbfa-4614-ab6f-60d9b3bcb786", + "path": "/leftStick/left", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "05c62b9e-e87b-4f7b-b200-257fc9593d48", + "path": "/leftStick/right", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "a67cf1da-5e2a-4878-b452-e7372daab939", + "path": "/space", + "interactions": "", + "processors": "", + "groups": "Keyboard and Mouse", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "debcc072-c2da-4503-b511-9ab019e55e1a", + "path": "/buttonEast", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Jump", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Right Stick", + "id": "35ad6eba-4737-4f44-a5b3-d6709bfaf303", + "path": "2DVector", + "interactions": "", + "processors": "", + "groups": "", + "action": "Look", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "189a746a-e4c6-4b4a-b9cc-de06067eb341", + "path": "/rightStick/up", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "c8952c61-21f1-4d54-9314-26a9c5338aa5", + "path": "/rightStick/down", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "aa0a5e3c-6e1d-4cda-a875-39e369d699ee", + "path": "/rightStick/left", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "fd3d2415-15f2-488d-b055-365ee2afc166", + "path": "/rightStick/right", + "interactions": "", + "processors": "", + "groups": "Gamepad", + "action": "Look", + "isComposite": false, + "isPartOfComposite": true + } + ] + } + ], + "controlSchemes": [ + { + "name": "Keyboard and Mouse", + "bindingGroup": "Keyboard and Mouse", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + }, + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + }, + { + "name": "Gamepad", + "bindingGroup": "Gamepad", + "devices": [ + { + "devicePath": "", + "isOptional": false, + "isOR": false + } + ] + } + ] +} \ No newline at end of file diff --git a/Assets/Input/PlayerControls.inputactions.meta b/Assets/Input/PlayerControls.inputactions.meta new file mode 100644 index 0000000..51ae264 --- /dev/null +++ b/Assets/Input/PlayerControls.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 7de8bb33c796ebf5b9ecde4234268d22 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 1 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/Assets/Input/README.txt b/Assets/Input/README.txt new file mode 100644 index 0000000..f5b7ce2 --- /dev/null +++ b/Assets/Input/README.txt @@ -0,0 +1 @@ +TO DO: Upgrade to the new input system. diff --git a/Assets/Input/README.txt.meta b/Assets/Input/README.txt.meta new file mode 100644 index 0000000..dc62ee1 --- /dev/null +++ b/Assets/Input/README.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a1b2632b142349041a169267430624cf +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: -- cgit v1.2.3