mirror of
https://github.com/ConjureETS/GameOff2024.git
synced 2026-03-24 13:10:58 +00:00
212 lines
7.6 KiB
C#
212 lines
7.6 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
// version 1.7.0
|
|
// from Assets/Scripts/GameInputs.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;
|
|
|
|
namespace GameOff
|
|
{
|
|
public partial class @GameInputs: IInputActionCollection2, IDisposable
|
|
{
|
|
public InputActionAsset asset { get; }
|
|
public @GameInputs()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""name"": ""GameInputs"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Player"",
|
|
""id"": ""da3c3195-8f3d-4214-8868-75a6a6838cd9"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""ChangeState"",
|
|
""type"": ""Button"",
|
|
""id"": ""e68b25df-26d5-444f-b400-30fd417637ce"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": ""Press"",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Mouse"",
|
|
""type"": ""Value"",
|
|
""id"": ""3d58ba17-a8e1-422d-a9b3-3da61a7f20aa"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""1e6edfed-a1c7-4203-b3ea-9ce526d76276"",
|
|
""path"": ""<Mouse>/rightButton"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""ChangeState"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""b66eea24-e7df-47d5-b151-f38e9fc3284d"",
|
|
""path"": ""<Keyboard>/p"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""ChangeState"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""ca799d40-b531-4015-96e7-37944f95d190"",
|
|
""path"": ""<Mouse>/delta"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Mouse"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": []
|
|
}");
|
|
// Player
|
|
m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
|
|
m_Player_ChangeState = m_Player.FindAction("ChangeState", throwIfNotFound: true);
|
|
m_Player_Mouse = m_Player.FindAction("Mouse", 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_ChangeState;
|
|
private readonly InputAction m_Player_Mouse;
|
|
public struct PlayerActions
|
|
{
|
|
private @GameInputs m_Wrapper;
|
|
public PlayerActions(@GameInputs wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @ChangeState => m_Wrapper.m_Player_ChangeState;
|
|
public InputAction @Mouse => m_Wrapper.m_Player_Mouse;
|
|
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);
|
|
@ChangeState.started += instance.OnChangeState;
|
|
@ChangeState.performed += instance.OnChangeState;
|
|
@ChangeState.canceled += instance.OnChangeState;
|
|
@Mouse.started += instance.OnMouse;
|
|
@Mouse.performed += instance.OnMouse;
|
|
@Mouse.canceled += instance.OnMouse;
|
|
}
|
|
|
|
private void UnregisterCallbacks(IPlayerActions instance)
|
|
{
|
|
@ChangeState.started -= instance.OnChangeState;
|
|
@ChangeState.performed -= instance.OnChangeState;
|
|
@ChangeState.canceled -= instance.OnChangeState;
|
|
@Mouse.started -= instance.OnMouse;
|
|
@Mouse.performed -= instance.OnMouse;
|
|
@Mouse.canceled -= instance.OnMouse;
|
|
}
|
|
|
|
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 OnChangeState(InputAction.CallbackContext context);
|
|
void OnMouse(InputAction.CallbackContext context);
|
|
}
|
|
}
|
|
}
|