769 lines
30 KiB
C#
769 lines
30 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
// version 1.7.0
|
|
// from Assets/PlayerInputScheme.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 @PlayerInputScheme: IInputActionCollection2, IDisposable
|
|
{
|
|
public InputActionAsset asset { get; }
|
|
public @PlayerInputScheme()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""name"": ""PlayerInputScheme"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Car"",
|
|
""id"": ""0edeaead-1488-4e62-8532-c64042d99363"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""forward"",
|
|
""type"": ""Value"",
|
|
""id"": ""b0192cdc-7e7a-4211-b682-d0cbdd84cac1"",
|
|
""expectedControlType"": ""Axis"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
},
|
|
{
|
|
""name"": ""horizontal"",
|
|
""type"": ""Button"",
|
|
""id"": ""b9cef62b-33c8-42c0-a5ea-9f128ac13581"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""pause"",
|
|
""type"": ""Button"",
|
|
""id"": ""4d23d26f-1cea-49d8-ab1e-dda345b62986"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": ""gamepad"",
|
|
""id"": ""87db7e9f-45c3-4263-b97c-3049f58ac197"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""forward"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""ebd45df9-ddfd-42e7-9e8c-51f8459a10b3"",
|
|
""path"": ""<Gamepad>/leftTrigger"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""forward"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""8fab3cca-fea9-4bcf-97ae-6787a1c5b45b"",
|
|
""path"": ""<Gamepad>/rightTrigger"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""forward"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""wasd"",
|
|
""id"": ""b0501139-ead2-4fb6-9986-34c712fdae6f"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""forward"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""af2c0802-11b3-4cb5-bccb-e5349504c2b9"",
|
|
""path"": ""<Keyboard>/#(W)"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""forward"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""70ebcaf8-15a4-44fa-929a-670c612916e4"",
|
|
""path"": ""<Keyboard>/s"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""forward"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""arrows"",
|
|
""id"": ""0c0f55f2-bb23-45a1-a532-35dbf2704bde"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""forward"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""6091448d-1343-4692-b504-a1d12580271b"",
|
|
""path"": ""<Keyboard>/upArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""forward"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""730119a2-61bc-4b96-a80e-ea099f12d194"",
|
|
""path"": ""<Keyboard>/downArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""forward"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""gamepad"",
|
|
""id"": ""fb51e1f5-f210-4203-ac79-4b00c7277ba9"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""c3e295d7-319e-4a3c-abff-170643840503"",
|
|
""path"": ""<Gamepad>/leftStick/left"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""cbadf142-560c-4e1d-a094-579f19237611"",
|
|
""path"": ""<Gamepad>/leftStick/right"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""wasd"",
|
|
""id"": ""c4418974-48ea-4584-802b-f949e8ce7871"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""a3d4156a-4fb8-485c-ad97-7be9e2c9cf1d"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""fc22a802-f80b-4079-b7ae-2f8958fb3978"",
|
|
""path"": ""<Keyboard>/a"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""arrows"",
|
|
""id"": ""666c9183-e944-409d-92bf-54a77f1807e6"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""d3ac4e8f-2a4c-422c-8b86-ad5edc214ce3"",
|
|
""path"": ""<Keyboard>/leftArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""80625c99-89cc-4371-b13a-363d31a5aa7e"",
|
|
""path"": ""<Keyboard>/rightArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Default"",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""9f511f57-7eab-4ca4-9a68-c7a15feff433"",
|
|
""path"": ""<Keyboard>/pause"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""pause"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""ba7bd1a3-ea64-40ee-a8cb-aeb0c4704f75"",
|
|
""path"": ""<Keyboard>/escape"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""pause"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""167c1b89-c2ac-4971-86ff-79d7d4893482"",
|
|
""path"": ""<Gamepad>/start"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""pause"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
""name"": ""UI"",
|
|
""id"": ""17fa73e4-4369-4161-9e95-1d6965261105"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""vertical"",
|
|
""type"": ""Button"",
|
|
""id"": ""1978676c-2048-4d41-b081-aee1ca80faa3"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""horizontal"",
|
|
""type"": ""Button"",
|
|
""id"": ""ce783541-1b27-49d1-b78a-372e9dedeacf"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""select"",
|
|
""type"": ""Button"",
|
|
""id"": ""dccad7a3-64eb-4f32-b263-77aa6b02c3d1"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": ""keyboard"",
|
|
""id"": ""c1806658-f420-4a2d-b8c8-ef0fb8416f9c"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""2c57ff20-a6b6-4cf4-bcd2-64bde9411d86"",
|
|
""path"": ""<Keyboard>/downArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""a5482a2d-ab63-4589-90b7-9dc7ebb26256"",
|
|
""path"": ""<Keyboard>/upArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""gamepadDpad"",
|
|
""id"": ""52321a42-8393-41b8-87aa-248d1df1c04c"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""0d3d73c3-bd11-4717-88f9-fae69b178ccd"",
|
|
""path"": ""<Gamepad>/dpad/down"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""4fdbcd9b-bff7-4a45-90a7-9d7d3c275c0d"",
|
|
""path"": ""<Gamepad>/dpad/up"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""gamepad"",
|
|
""id"": ""4d76320a-02c7-42ee-8cf8-8e18118b1c76"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""937d80f8-432b-47a5-b8b1-f20de3abf4db"",
|
|
""path"": ""<Gamepad>/leftStick/down"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""8fc41c3a-7104-4621-a0e6-184a64dc7610"",
|
|
""path"": ""<Gamepad>/leftStick/up"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""vertical"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""4da991a2-76cb-4259-9d87-9d1f795a55b5"",
|
|
""path"": ""<Keyboard>/enter"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""select"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""372985da-b26c-474a-9be0-8e1052d81b9b"",
|
|
""path"": ""<Gamepad>/buttonSouth"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""select"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""keyboard"",
|
|
""id"": ""4f48ed55-c841-4c13-bef6-f9082e870143"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""5a27f78f-b4c2-4271-8e81-3502dece99be"",
|
|
""path"": ""<Keyboard>/leftArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""11d6fc86-7f0b-4f81-9dbf-9278c4771f10"",
|
|
""path"": ""<Keyboard>/rightArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""gamepadDpad"",
|
|
""id"": ""8d710f71-579e-4fe2-98a6-cba45962c82d"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""0ea6d986-8c31-4a9e-abfb-440a4a866c38"",
|
|
""path"": ""<Gamepad>/dpad/left"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""b7ad09e9-547c-444b-99f8-134a3e239403"",
|
|
""path"": ""<Gamepad>/dpad/left"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""gamepad"",
|
|
""id"": ""a887bb21-d837-4488-adde-ff11f36155bb"",
|
|
""path"": ""1DAxis"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""negative"",
|
|
""id"": ""16708654-a9fd-4285-9a74-fe6664462615"",
|
|
""path"": ""<Gamepad>/leftStick/left"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""positive"",
|
|
""id"": ""200102e2-9791-404a-874f-623ed1072a82"",
|
|
""path"": ""<Gamepad>/leftStick/right"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""horizontal"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": [
|
|
{
|
|
""name"": ""Default"",
|
|
""bindingGroup"": ""Default"",
|
|
""devices"": []
|
|
}
|
|
]
|
|
}");
|
|
// Car
|
|
m_Car = asset.FindActionMap("Car", throwIfNotFound: true);
|
|
m_Car_forward = m_Car.FindAction("forward", throwIfNotFound: true);
|
|
m_Car_horizontal = m_Car.FindAction("horizontal", throwIfNotFound: true);
|
|
m_Car_pause = m_Car.FindAction("pause", throwIfNotFound: true);
|
|
// UI
|
|
m_UI = asset.FindActionMap("UI", throwIfNotFound: true);
|
|
m_UI_vertical = m_UI.FindAction("vertical", throwIfNotFound: true);
|
|
m_UI_horizontal = m_UI.FindAction("horizontal", throwIfNotFound: true);
|
|
m_UI_select = m_UI.FindAction("select", 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);
|
|
}
|
|
|
|
// Car
|
|
private readonly InputActionMap m_Car;
|
|
private List<ICarActions> m_CarActionsCallbackInterfaces = new List<ICarActions>();
|
|
private readonly InputAction m_Car_forward;
|
|
private readonly InputAction m_Car_horizontal;
|
|
private readonly InputAction m_Car_pause;
|
|
public struct CarActions
|
|
{
|
|
private @PlayerInputScheme m_Wrapper;
|
|
public CarActions(@PlayerInputScheme wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @forward => m_Wrapper.m_Car_forward;
|
|
public InputAction @horizontal => m_Wrapper.m_Car_horizontal;
|
|
public InputAction @pause => m_Wrapper.m_Car_pause;
|
|
public InputActionMap Get() { return m_Wrapper.m_Car; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(CarActions set) { return set.Get(); }
|
|
public void AddCallbacks(ICarActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_CarActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_CarActionsCallbackInterfaces.Add(instance);
|
|
@forward.started += instance.OnForward;
|
|
@forward.performed += instance.OnForward;
|
|
@forward.canceled += instance.OnForward;
|
|
@horizontal.started += instance.OnHorizontal;
|
|
@horizontal.performed += instance.OnHorizontal;
|
|
@horizontal.canceled += instance.OnHorizontal;
|
|
@pause.started += instance.OnPause;
|
|
@pause.performed += instance.OnPause;
|
|
@pause.canceled += instance.OnPause;
|
|
}
|
|
|
|
private void UnregisterCallbacks(ICarActions instance)
|
|
{
|
|
@forward.started -= instance.OnForward;
|
|
@forward.performed -= instance.OnForward;
|
|
@forward.canceled -= instance.OnForward;
|
|
@horizontal.started -= instance.OnHorizontal;
|
|
@horizontal.performed -= instance.OnHorizontal;
|
|
@horizontal.canceled -= instance.OnHorizontal;
|
|
@pause.started -= instance.OnPause;
|
|
@pause.performed -= instance.OnPause;
|
|
@pause.canceled -= instance.OnPause;
|
|
}
|
|
|
|
public void RemoveCallbacks(ICarActions instance)
|
|
{
|
|
if (m_Wrapper.m_CarActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
public void SetCallbacks(ICarActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_CarActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_CarActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
public CarActions @Car => new CarActions(this);
|
|
|
|
// UI
|
|
private readonly InputActionMap m_UI;
|
|
private List<IUIActions> m_UIActionsCallbackInterfaces = new List<IUIActions>();
|
|
private readonly InputAction m_UI_vertical;
|
|
private readonly InputAction m_UI_horizontal;
|
|
private readonly InputAction m_UI_select;
|
|
public struct UIActions
|
|
{
|
|
private @PlayerInputScheme m_Wrapper;
|
|
public UIActions(@PlayerInputScheme wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @vertical => m_Wrapper.m_UI_vertical;
|
|
public InputAction @horizontal => m_Wrapper.m_UI_horizontal;
|
|
public InputAction @select => m_Wrapper.m_UI_select;
|
|
public InputActionMap Get() { return m_Wrapper.m_UI; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(UIActions set) { return set.Get(); }
|
|
public void AddCallbacks(IUIActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_UIActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_UIActionsCallbackInterfaces.Add(instance);
|
|
@vertical.started += instance.OnVertical;
|
|
@vertical.performed += instance.OnVertical;
|
|
@vertical.canceled += instance.OnVertical;
|
|
@horizontal.started += instance.OnHorizontal;
|
|
@horizontal.performed += instance.OnHorizontal;
|
|
@horizontal.canceled += instance.OnHorizontal;
|
|
@select.started += instance.OnSelect;
|
|
@select.performed += instance.OnSelect;
|
|
@select.canceled += instance.OnSelect;
|
|
}
|
|
|
|
private void UnregisterCallbacks(IUIActions instance)
|
|
{
|
|
@vertical.started -= instance.OnVertical;
|
|
@vertical.performed -= instance.OnVertical;
|
|
@vertical.canceled -= instance.OnVertical;
|
|
@horizontal.started -= instance.OnHorizontal;
|
|
@horizontal.performed -= instance.OnHorizontal;
|
|
@horizontal.canceled -= instance.OnHorizontal;
|
|
@select.started -= instance.OnSelect;
|
|
@select.performed -= instance.OnSelect;
|
|
@select.canceled -= instance.OnSelect;
|
|
}
|
|
|
|
public void RemoveCallbacks(IUIActions instance)
|
|
{
|
|
if (m_Wrapper.m_UIActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
public void SetCallbacks(IUIActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_UIActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_UIActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
public UIActions @UI => new UIActions(this);
|
|
private int m_DefaultSchemeIndex = -1;
|
|
public InputControlScheme DefaultScheme
|
|
{
|
|
get
|
|
{
|
|
if (m_DefaultSchemeIndex == -1) m_DefaultSchemeIndex = asset.FindControlSchemeIndex("Default");
|
|
return asset.controlSchemes[m_DefaultSchemeIndex];
|
|
}
|
|
}
|
|
public interface ICarActions
|
|
{
|
|
void OnForward(InputAction.CallbackContext context);
|
|
void OnHorizontal(InputAction.CallbackContext context);
|
|
void OnPause(InputAction.CallbackContext context);
|
|
}
|
|
public interface IUIActions
|
|
{
|
|
void OnVertical(InputAction.CallbackContext context);
|
|
void OnHorizontal(InputAction.CallbackContext context);
|
|
void OnSelect(InputAction.CallbackContext context);
|
|
}
|
|
}
|