menu
This commit is contained in:
1 parent
6eb7bac08a
commit
6704c3ae59
46 files changed
+5298
-74
No files matched your search
+136
-44
@@ -2,7 +2,7 @@
|
||||
// <auto-generated>
|
||||
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
||||
// version 1.6.1
|
||||
// from Assets/Resources/ShipInput.inputactions
|
||||
// from Assets/Resources/SpaceRaceInput.inputactions
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
@@ -15,16 +15,16 @@ using System.Collections.Generic;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.InputSystem.Utilities;
|
||||
|
||||
public partial class @ShipInput: IInputActionCollection2, IDisposable
|
||||
public partial class @SpaceRaceInput: IInputActionCollection2, IDisposable
|
||||
{
|
||||
public InputActionAsset asset { get; }
|
||||
public @ShipInput()
|
||||
public @SpaceRaceInput()
|
||||
{
|
||||
asset = InputActionAsset.FromJson(@"{
|
||||
""name"": ""ShipInput"",
|
||||
""name"": ""SpaceRaceInput"",
|
||||
""maps"": [
|
||||
{
|
||||
""name"": ""movement"",
|
||||
""name"": ""ship"",
|
||||
""id"": ""f52df5ad-4b20-4a0e-a4c8-bbf76c26b2c5"",
|
||||
""actions"": [
|
||||
{
|
||||
@@ -337,18 +337,60 @@ public partial class @ShipInput: IInputActionCollection2, IDisposable
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
""name"": ""menu"",
|
||||
""id"": ""88ca6226-1e9b-4abe-b02e-7b1304ef28ae"",
|
||||
""actions"": [
|
||||
{
|
||||
""name"": ""ToggleMenu"",
|
||||
""type"": ""Button"",
|
||||
""id"": ""cee6d41d-d488-4548-b2d6-11e16bb6b116"",
|
||||
""expectedControlType"": ""Button"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": false
|
||||
}
|
||||
],
|
||||
""bindings"": [
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""264c9b3e-9257-4ea7-ad15-c2469ae762f2"",
|
||||
""path"": ""<Gamepad>/start"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""ToggleMenu"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
},
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""1a12ee48-3233-43b7-88a3-175016b24098"",
|
||||
""path"": ""<Keyboard>/escape"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""ToggleMenu"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
""controlSchemes"": []
|
||||
}");
|
||||
// movement
|
||||
m_movement = asset.FindActionMap("movement", throwIfNotFound: true);
|
||||
m_movement_accelerate = m_movement.FindAction("accelerate", throwIfNotFound: true);
|
||||
m_movement_decelerate = m_movement.FindAction("decelerate", throwIfNotFound: true);
|
||||
m_movement_strafe = m_movement.FindAction("strafe", throwIfNotFound: true);
|
||||
m_movement_look = m_movement.FindAction("look", throwIfNotFound: true);
|
||||
m_movement_respawn = m_movement.FindAction("respawn", throwIfNotFound: true);
|
||||
m_movement_quit = m_movement.FindAction("quit", throwIfNotFound: true);
|
||||
// ship
|
||||
m_ship = asset.FindActionMap("ship", throwIfNotFound: true);
|
||||
m_ship_accelerate = m_ship.FindAction("accelerate", throwIfNotFound: true);
|
||||
m_ship_decelerate = m_ship.FindAction("decelerate", throwIfNotFound: true);
|
||||
m_ship_strafe = m_ship.FindAction("strafe", throwIfNotFound: true);
|
||||
m_ship_look = m_ship.FindAction("look", throwIfNotFound: true);
|
||||
m_ship_respawn = m_ship.FindAction("respawn", throwIfNotFound: true);
|
||||
m_ship_quit = m_ship.FindAction("quit", throwIfNotFound: true);
|
||||
// menu
|
||||
m_menu = asset.FindActionMap("menu", throwIfNotFound: true);
|
||||
m_menu_ToggleMenu = m_menu.FindAction("ToggleMenu", throwIfNotFound: true);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@@ -407,34 +449,34 @@ public partial class @ShipInput: IInputActionCollection2, IDisposable
|
||||
return asset.FindBinding(bindingMask, out action);
|
||||
}
|
||||
|
||||
// movement
|
||||
private readonly InputActionMap m_movement;
|
||||
private List<IMovementActions> m_MovementActionsCallbackInterfaces = new List<IMovementActions>();
|
||||
private readonly InputAction m_movement_accelerate;
|
||||
private readonly InputAction m_movement_decelerate;
|
||||
private readonly InputAction m_movement_strafe;
|
||||
private readonly InputAction m_movement_look;
|
||||
private readonly InputAction m_movement_respawn;
|
||||
private readonly InputAction m_movement_quit;
|
||||
public struct MovementActions
|
||||
// ship
|
||||
private readonly InputActionMap m_ship;
|
||||
private List<IShipActions> m_ShipActionsCallbackInterfaces = new List<IShipActions>();
|
||||
private readonly InputAction m_ship_accelerate;
|
||||
private readonly InputAction m_ship_decelerate;
|
||||
private readonly InputAction m_ship_strafe;
|
||||
private readonly InputAction m_ship_look;
|
||||
private readonly InputAction m_ship_respawn;
|
||||
private readonly InputAction m_ship_quit;
|
||||
public struct ShipActions
|
||||
{
|
||||
private @ShipInput m_Wrapper;
|
||||
public MovementActions(@ShipInput wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @accelerate => m_Wrapper.m_movement_accelerate;
|
||||
public InputAction @decelerate => m_Wrapper.m_movement_decelerate;
|
||||
public InputAction @strafe => m_Wrapper.m_movement_strafe;
|
||||
public InputAction @look => m_Wrapper.m_movement_look;
|
||||
public InputAction @respawn => m_Wrapper.m_movement_respawn;
|
||||
public InputAction @quit => m_Wrapper.m_movement_quit;
|
||||
public InputActionMap Get() { return m_Wrapper.m_movement; }
|
||||
private @SpaceRaceInput m_Wrapper;
|
||||
public ShipActions(@SpaceRaceInput wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @accelerate => m_Wrapper.m_ship_accelerate;
|
||||
public InputAction @decelerate => m_Wrapper.m_ship_decelerate;
|
||||
public InputAction @strafe => m_Wrapper.m_ship_strafe;
|
||||
public InputAction @look => m_Wrapper.m_ship_look;
|
||||
public InputAction @respawn => m_Wrapper.m_ship_respawn;
|
||||
public InputAction @quit => m_Wrapper.m_ship_quit;
|
||||
public InputActionMap Get() { return m_Wrapper.m_ship; }
|
||||
public void Enable() { Get().Enable(); }
|
||||
public void Disable() { Get().Disable(); }
|
||||
public bool enabled => Get().enabled;
|
||||
public static implicit operator InputActionMap(MovementActions set) { return set.Get(); }
|
||||
public void AddCallbacks(IMovementActions instance)
|
||||
public static implicit operator InputActionMap(ShipActions set) { return set.Get(); }
|
||||
public void AddCallbacks(IShipActions instance)
|
||||
{
|
||||
if (instance == null || m_Wrapper.m_MovementActionsCallbackInterfaces.Contains(instance)) return;
|
||||
m_Wrapper.m_MovementActionsCallbackInterfaces.Add(instance);
|
||||
if (instance == null || m_Wrapper.m_ShipActionsCallbackInterfaces.Contains(instance)) return;
|
||||
m_Wrapper.m_ShipActionsCallbackInterfaces.Add(instance);
|
||||
@accelerate.started += instance.OnAccelerate;
|
||||
@accelerate.performed += instance.OnAccelerate;
|
||||
@accelerate.canceled += instance.OnAccelerate;
|
||||
@@ -455,7 +497,7 @@ public partial class @ShipInput: IInputActionCollection2, IDisposable
|
||||
@quit.canceled += instance.OnQuit;
|
||||
}
|
||||
|
||||
private void UnregisterCallbacks(IMovementActions instance)
|
||||
private void UnregisterCallbacks(IShipActions instance)
|
||||
{
|
||||
@accelerate.started -= instance.OnAccelerate;
|
||||
@accelerate.performed -= instance.OnAccelerate;
|
||||
@@ -477,22 +519,68 @@ public partial class @ShipInput: IInputActionCollection2, IDisposable
|
||||
@quit.canceled -= instance.OnQuit;
|
||||
}
|
||||
|
||||
public void RemoveCallbacks(IMovementActions instance)
|
||||
public void RemoveCallbacks(IShipActions instance)
|
||||
{
|
||||
if (m_Wrapper.m_MovementActionsCallbackInterfaces.Remove(instance))
|
||||
if (m_Wrapper.m_ShipActionsCallbackInterfaces.Remove(instance))
|
||||
UnregisterCallbacks(instance);
|
||||
}
|
||||
|
||||
public void SetCallbacks(IMovementActions instance)
|
||||
public void SetCallbacks(IShipActions instance)
|
||||
{
|
||||
foreach (var item in m_Wrapper.m_MovementActionsCallbackInterfaces)
|
||||
foreach (var item in m_Wrapper.m_ShipActionsCallbackInterfaces)
|
||||
UnregisterCallbacks(item);
|
||||
m_Wrapper.m_MovementActionsCallbackInterfaces.Clear();
|
||||
m_Wrapper.m_ShipActionsCallbackInterfaces.Clear();
|
||||
AddCallbacks(instance);
|
||||
}
|
||||
}
|
||||
public MovementActions @movement => new MovementActions(this);
|
||||
public interface IMovementActions
|
||||
public ShipActions @ship => new ShipActions(this);
|
||||
|
||||
// menu
|
||||
private readonly InputActionMap m_menu;
|
||||
private List<IMenuActions> m_MenuActionsCallbackInterfaces = new List<IMenuActions>();
|
||||
private readonly InputAction m_menu_ToggleMenu;
|
||||
public struct MenuActions
|
||||
{
|
||||
private @SpaceRaceInput m_Wrapper;
|
||||
public MenuActions(@SpaceRaceInput wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @ToggleMenu => m_Wrapper.m_menu_ToggleMenu;
|
||||
public InputActionMap Get() { return m_Wrapper.m_menu; }
|
||||
public void Enable() { Get().Enable(); }
|
||||
public void Disable() { Get().Disable(); }
|
||||
public bool enabled => Get().enabled;
|
||||
public static implicit operator InputActionMap(MenuActions set) { return set.Get(); }
|
||||
public void AddCallbacks(IMenuActions instance)
|
||||
{
|
||||
if (instance == null || m_Wrapper.m_MenuActionsCallbackInterfaces.Contains(instance)) return;
|
||||
m_Wrapper.m_MenuActionsCallbackInterfaces.Add(instance);
|
||||
@ToggleMenu.started += instance.OnToggleMenu;
|
||||
@ToggleMenu.performed += instance.OnToggleMenu;
|
||||
@ToggleMenu.canceled += instance.OnToggleMenu;
|
||||
}
|
||||
|
||||
private void UnregisterCallbacks(IMenuActions instance)
|
||||
{
|
||||
@ToggleMenu.started -= instance.OnToggleMenu;
|
||||
@ToggleMenu.performed -= instance.OnToggleMenu;
|
||||
@ToggleMenu.canceled -= instance.OnToggleMenu;
|
||||
}
|
||||
|
||||
public void RemoveCallbacks(IMenuActions instance)
|
||||
{
|
||||
if (m_Wrapper.m_MenuActionsCallbackInterfaces.Remove(instance))
|
||||
UnregisterCallbacks(instance);
|
||||
}
|
||||
|
||||
public void SetCallbacks(IMenuActions instance)
|
||||
{
|
||||
foreach (var item in m_Wrapper.m_MenuActionsCallbackInterfaces)
|
||||
UnregisterCallbacks(item);
|
||||
m_Wrapper.m_MenuActionsCallbackInterfaces.Clear();
|
||||
AddCallbacks(instance);
|
||||
}
|
||||
}
|
||||
public MenuActions @menu => new MenuActions(this);
|
||||
public interface IShipActions
|
||||
{
|
||||
void OnAccelerate(InputAction.CallbackContext context);
|
||||
void OnDecelerate(InputAction.CallbackContext context);
|
||||
@@ -501,4 +589,8 @@ public partial class @ShipInput: IInputActionCollection2, IDisposable
|
||||
void OnRespawn(InputAction.CallbackContext context);
|
||||
void OnQuit(InputAction.CallbackContext context);
|
||||
}
|
||||
public interface IMenuActions
|
||||
{
|
||||
void OnToggleMenu(InputAction.CallbackContext context);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user