Integrated custom car movements and fixed issues with follow camera behaviours.
302 lines
11 KiB
C#
302 lines
11 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
// version 1.7.0
|
|
// from Assets/PlayerInputAction.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 @PlayerInputAction: IInputActionCollection2, IDisposable
|
|
{
|
|
public InputActionAsset asset { get; }
|
|
public @PlayerInputAction()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""name"": ""PlayerInputAction"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Player"",
|
|
""id"": ""857bc825-28ff-4de6-a566-17000cf625fa"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""Jump"",
|
|
""type"": ""Button"",
|
|
""id"": ""9c293672-2623-4517-9b3e-eab04ee3544e"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Move"",
|
|
""type"": ""Value"",
|
|
""id"": ""f77a8dd7-6431-4fa9-ba52-1102c1210d65"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
},
|
|
{
|
|
""name"": ""TouchInput"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""2d2c8e85-7298-4765-a196-5485b1ed8379"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""TouchPress"",
|
|
""type"": ""Button"",
|
|
""id"": ""e35afb81-50e8-4b03-be3c-dd2ba5828635"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""2edafdfd-f7f6-4a1c-b374-12b61b459271"",
|
|
""path"": ""<Keyboard>/space"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Jump"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""2D Vector"",
|
|
""id"": ""31e26ecb-efa0-428a-972e-1dba4195b75e"",
|
|
""path"": ""2DVector"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""up"",
|
|
""id"": ""40181451-9ed6-4b24-a216-c6013858ed1a"",
|
|
""path"": ""<Keyboard>/w"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""down"",
|
|
""id"": ""b872d7c2-30c9-45ff-a85f-5eac185cdebc"",
|
|
""path"": ""<Keyboard>/s"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""left"",
|
|
""id"": ""33752d10-fef2-49d9-93a0-e9ada12d0636"",
|
|
""path"": ""<Keyboard>/a"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""right"",
|
|
""id"": ""70222a3b-36ad-4d1e-ac03-eee1db76adf7"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Move"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""ca2a4457-d3b5-4319-9d12-a0a5b03b659c"",
|
|
""path"": ""<Touchscreen>/primaryTouch/indirectTouch"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""TouchInput"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""74be92f8-d232-47f2-beb5-4ec0c795b463"",
|
|
""path"": ""<Touchscreen>/primaryTouch/press"",
|
|
""interactions"": ""Press"",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""TouchPress"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": []
|
|
}");
|
|
// Player
|
|
m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
|
|
m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true);
|
|
m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
|
|
m_Player_TouchInput = m_Player.FindAction("TouchInput", throwIfNotFound: true);
|
|
m_Player_TouchPress = m_Player.FindAction("TouchPress", 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);
|
|
}
|
|
|
|
// Player
|
|
private readonly InputActionMap m_Player;
|
|
private List<IPlayerActions> m_PlayerActionsCallbackInterfaces = new List<IPlayerActions>();
|
|
private readonly InputAction m_Player_Jump;
|
|
private readonly InputAction m_Player_Move;
|
|
private readonly InputAction m_Player_TouchInput;
|
|
private readonly InputAction m_Player_TouchPress;
|
|
public struct PlayerActions
|
|
{
|
|
private @PlayerInputAction m_Wrapper;
|
|
public PlayerActions(@PlayerInputAction wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @Jump => m_Wrapper.m_Player_Jump;
|
|
public InputAction @Move => m_Wrapper.m_Player_Move;
|
|
public InputAction @TouchInput => m_Wrapper.m_Player_TouchInput;
|
|
public InputAction @TouchPress => m_Wrapper.m_Player_TouchPress;
|
|
public InputActionMap Get() { return m_Wrapper.m_Player; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); }
|
|
public void AddCallbacks(IPlayerActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance);
|
|
@Jump.started += instance.OnJump;
|
|
@Jump.performed += instance.OnJump;
|
|
@Jump.canceled += instance.OnJump;
|
|
@Move.started += instance.OnMove;
|
|
@Move.performed += instance.OnMove;
|
|
@Move.canceled += instance.OnMove;
|
|
@TouchInput.started += instance.OnTouchInput;
|
|
@TouchInput.performed += instance.OnTouchInput;
|
|
@TouchInput.canceled += instance.OnTouchInput;
|
|
@TouchPress.started += instance.OnTouchPress;
|
|
@TouchPress.performed += instance.OnTouchPress;
|
|
@TouchPress.canceled += instance.OnTouchPress;
|
|
}
|
|
|
|
private void UnregisterCallbacks(IPlayerActions instance)
|
|
{
|
|
@Jump.started -= instance.OnJump;
|
|
@Jump.performed -= instance.OnJump;
|
|
@Jump.canceled -= instance.OnJump;
|
|
@Move.started -= instance.OnMove;
|
|
@Move.performed -= instance.OnMove;
|
|
@Move.canceled -= instance.OnMove;
|
|
@TouchInput.started -= instance.OnTouchInput;
|
|
@TouchInput.performed -= instance.OnTouchInput;
|
|
@TouchInput.canceled -= instance.OnTouchInput;
|
|
@TouchPress.started -= instance.OnTouchPress;
|
|
@TouchPress.performed -= instance.OnTouchPress;
|
|
@TouchPress.canceled -= instance.OnTouchPress;
|
|
}
|
|
|
|
public void RemoveCallbacks(IPlayerActions instance)
|
|
{
|
|
if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
public void SetCallbacks(IPlayerActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
public PlayerActions @Player => new PlayerActions(this);
|
|
public interface IPlayerActions
|
|
{
|
|
void OnJump(InputAction.CallbackContext context);
|
|
void OnMove(InputAction.CallbackContext context);
|
|
void OnTouchInput(InputAction.CallbackContext context);
|
|
void OnTouchPress(InputAction.CallbackContext context);
|
|
}
|
|
}
|