OldBlueWater/BlueWater/Assets/02.Scripts/BlueWater.cs

591 lines
23 KiB
C#
Raw Normal View History

2023-08-02 09:12:26 +00:00
//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.6.3
// from Assets/02.Scripts/BlueWater.inputactions
2023-08-02 09:12:26 +00:00
//
// 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 @BlueWater: IInputActionCollection2, IDisposable
{
public InputActionAsset asset { get; }
public @BlueWater()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""BlueWater"",
""maps"": [
{
""name"": ""Player"",
""id"": ""9fe03cc1-5cd3-4b79-a95e-461613cb242e"",
""actions"": [
{
""name"": ""Move"",
""type"": ""Value"",
""id"": ""e46165d9-8066-4400-8950-9b7d4bb9ca75"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true
2023-08-08 07:08:41 +00:00
},
{
""name"": ""AssaultMode"",
2023-08-08 07:08:41 +00:00
""type"": ""Button"",
""id"": ""7d9814fb-48e0-4717-91c3-0c7b7d99972c"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
2023-08-11 16:21:26 +00:00
},
{
""name"": ""Interaction"",
""type"": ""Button"",
""id"": ""367e7267-d329-439d-9806-5e960b8114b5"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": ""Tap"",
""initialStateCheck"": false
},
{
""name"": ""InteractionHold"",
""type"": ""Button"",
""id"": ""a28fe5f5-b2a2-4794-8f99-fa2494aedfc3"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": ""Hold(duration=1)"",
""initialStateCheck"": false
2023-08-17 03:42:12 +00:00
},
{
""name"": ""Zkey"",
""type"": ""Button"",
""id"": ""548e1aff-2de9-4dcc-8fe3-6c20ee0e74d4"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
{
2023-08-03 01:03:08 +00:00
""name"": ""WASD"",
""id"": ""4dc5b54c-0e59-461e-a12d-470900925a36"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""07083b18-8b38-4c90-ae78-28c2927a5f82"",
""path"": ""<Keyboard>/w"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""3b75699e-1063-4230-9ac3-95292c44d2bd"",
""path"": ""<Keyboard>/s"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""6bdc290d-3bc8-4e00-b868-1977d3f2267d"",
""path"": ""<Keyboard>/a"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""03206e08-b0b8-4a95-9bf8-a3e4fd10d4db"",
""path"": ""<Keyboard>/d"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
2023-08-08 07:08:41 +00:00
},
{
""name"": """",
""id"": ""8e9091c9-b649-4709-bae7-3ca464124529"",
""path"": ""<Keyboard>/v"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard"",
""action"": ""AssaultMode"",
2023-08-08 07:08:41 +00:00
""isComposite"": false,
""isPartOfComposite"": false
2023-08-11 16:21:26 +00:00
},
{
""name"": """",
""id"": ""334d8c88-f0ee-43d9-b62d-a1fdbd1bc338"",
""path"": ""<Keyboard>/f"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard"",
""action"": ""Interaction"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""df7a5259-c313-4b14-9cca-9e1acfc0a31a"",
""path"": ""<Keyboard>/f"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard"",
""action"": ""InteractionHold"",
""isComposite"": false,
""isPartOfComposite"": false
2023-08-17 03:42:12 +00:00
},
{
""name"": """",
""id"": ""3db50dad-5cf1-4778-a8a6-27a83398045b"",
""path"": ""<Keyboard>/z"",
""interactions"": """",
""processors"": """",
""groups"": ""Keyboard"",
""action"": ""Zkey"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
},
{
""name"": ""Camera"",
""id"": ""06b461c0-220a-44f8-a03e-0302537ffe0c"",
""actions"": [
{
""name"": ""Zoom"",
""type"": ""Value"",
""id"": ""26cdda4e-9797-43df-a511-7745f1de2567"",
""expectedControlType"": ""Axis"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true
},
{
""name"": ""Rotate"",
""type"": ""Button"",
""id"": ""d9db46b6-0228-4e7f-8b51-53cae3ccc330"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
{
""name"": """",
""id"": ""6cbe83f3-bb32-4b85-9419-f88897bd4fc4"",
""path"": ""<Mouse>/scroll/y"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Zoom"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""e68715cb-964b-4648-9cef-3afefbe84441"",
""path"": ""<Mouse>/rightButton"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Rotate"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""4bc83c87-5345-4fb2-b39a-ac975f7bf47e"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Rotate"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
},
{
""name"": ""Unit"",
""id"": ""72deb161-83b9-4d14-8bcf-0bd0c122f76f"",
""actions"": [
{
""name"": ""LeftClick"",
""type"": ""Button"",
""id"": ""2c1978d2-b4be-453a-9413-7b54903dbf38"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""RightClick"",
""type"": ""Button"",
""id"": ""2fe8434e-42e2-4b88-b0b3-0b2b4f8596a8"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
{
""name"": """",
""id"": ""2daa9903-ce4b-4c8d-9347-5f59b09e8674"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""LeftClick"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""76632044-5edc-4dba-97aa-64d5173c78ec"",
""path"": ""<Mouse>/rightButton"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""RightClick"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
],
""controlSchemes"": [
{
""name"": ""Keyboard"",
""bindingGroup"": ""Keyboard"",
""devices"": [
{
""devicePath"": ""<Keyboard>"",
""isOptional"": false,
""isOR"": false
},
{
""devicePath"": ""<Mouse>"",
""isOptional"": false,
""isOR"": false
}
]
}
]
2023-08-02 09:12:26 +00:00
}");
// Player
m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true);
m_Player_AssaultMode = m_Player.FindAction("AssaultMode", throwIfNotFound: true);
2023-08-11 16:21:26 +00:00
m_Player_Interaction = m_Player.FindAction("Interaction", throwIfNotFound: true);
m_Player_InteractionHold = m_Player.FindAction("InteractionHold", throwIfNotFound: true);
2023-08-17 03:42:12 +00:00
m_Player_Zkey = m_Player.FindAction("Zkey", throwIfNotFound: true);
// Camera
m_Camera = asset.FindActionMap("Camera", throwIfNotFound: true);
m_Camera_Zoom = m_Camera.FindAction("Zoom", throwIfNotFound: true);
m_Camera_Rotate = m_Camera.FindAction("Rotate", throwIfNotFound: true);
// Unit
m_Unit = asset.FindActionMap("Unit", throwIfNotFound: true);
m_Unit_LeftClick = m_Unit.FindAction("LeftClick", throwIfNotFound: true);
m_Unit_RightClick = m_Unit.FindAction("RightClick", throwIfNotFound: true);
2023-08-02 09:12:26 +00:00
}
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_Move;
private readonly InputAction m_Player_AssaultMode;
2023-08-11 16:21:26 +00:00
private readonly InputAction m_Player_Interaction;
private readonly InputAction m_Player_InteractionHold;
2023-08-17 03:42:12 +00:00
private readonly InputAction m_Player_Zkey;
public struct PlayerActions
{
private @BlueWater m_Wrapper;
public PlayerActions(@BlueWater wrapper) { m_Wrapper = wrapper; }
public InputAction @Move => m_Wrapper.m_Player_Move;
public InputAction @AssaultMode => m_Wrapper.m_Player_AssaultMode;
2023-08-11 16:21:26 +00:00
public InputAction @Interaction => m_Wrapper.m_Player_Interaction;
public InputAction @InteractionHold => m_Wrapper.m_Player_InteractionHold;
2023-08-17 03:42:12 +00:00
public InputAction @Zkey => m_Wrapper.m_Player_Zkey;
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);
@Move.started += instance.OnMove;
@Move.performed += instance.OnMove;
@Move.canceled += instance.OnMove;
@AssaultMode.started += instance.OnAssaultMode;
@AssaultMode.performed += instance.OnAssaultMode;
@AssaultMode.canceled += instance.OnAssaultMode;
2023-08-11 16:21:26 +00:00
@Interaction.started += instance.OnInteraction;
@Interaction.performed += instance.OnInteraction;
@Interaction.canceled += instance.OnInteraction;
@InteractionHold.started += instance.OnInteractionHold;
@InteractionHold.performed += instance.OnInteractionHold;
@InteractionHold.canceled += instance.OnInteractionHold;
2023-08-17 03:42:12 +00:00
@Zkey.started += instance.OnZkey;
@Zkey.performed += instance.OnZkey;
@Zkey.canceled += instance.OnZkey;
}
private void UnregisterCallbacks(IPlayerActions instance)
{
@Move.started -= instance.OnMove;
@Move.performed -= instance.OnMove;
@Move.canceled -= instance.OnMove;
@AssaultMode.started -= instance.OnAssaultMode;
@AssaultMode.performed -= instance.OnAssaultMode;
@AssaultMode.canceled -= instance.OnAssaultMode;
2023-08-11 16:21:26 +00:00
@Interaction.started -= instance.OnInteraction;
@Interaction.performed -= instance.OnInteraction;
@Interaction.canceled -= instance.OnInteraction;
@InteractionHold.started -= instance.OnInteractionHold;
@InteractionHold.performed -= instance.OnInteractionHold;
@InteractionHold.canceled -= instance.OnInteractionHold;
2023-08-17 03:42:12 +00:00
@Zkey.started -= instance.OnZkey;
@Zkey.performed -= instance.OnZkey;
@Zkey.canceled -= instance.OnZkey;
}
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);
// Camera
private readonly InputActionMap m_Camera;
private List<ICameraActions> m_CameraActionsCallbackInterfaces = new List<ICameraActions>();
private readonly InputAction m_Camera_Zoom;
private readonly InputAction m_Camera_Rotate;
public struct CameraActions
{
private @BlueWater m_Wrapper;
public CameraActions(@BlueWater wrapper) { m_Wrapper = wrapper; }
public InputAction @Zoom => m_Wrapper.m_Camera_Zoom;
public InputAction @Rotate => m_Wrapper.m_Camera_Rotate;
public InputActionMap Get() { return m_Wrapper.m_Camera; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(CameraActions set) { return set.Get(); }
public void AddCallbacks(ICameraActions instance)
{
if (instance == null || m_Wrapper.m_CameraActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_CameraActionsCallbackInterfaces.Add(instance);
@Zoom.started += instance.OnZoom;
@Zoom.performed += instance.OnZoom;
@Zoom.canceled += instance.OnZoom;
@Rotate.started += instance.OnRotate;
@Rotate.performed += instance.OnRotate;
@Rotate.canceled += instance.OnRotate;
}
private void UnregisterCallbacks(ICameraActions instance)
{
@Zoom.started -= instance.OnZoom;
@Zoom.performed -= instance.OnZoom;
@Zoom.canceled -= instance.OnZoom;
@Rotate.started -= instance.OnRotate;
@Rotate.performed -= instance.OnRotate;
@Rotate.canceled -= instance.OnRotate;
}
public void RemoveCallbacks(ICameraActions instance)
{
if (m_Wrapper.m_CameraActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(ICameraActions instance)
{
foreach (var item in m_Wrapper.m_CameraActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_CameraActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public CameraActions @Camera => new CameraActions(this);
// Unit
private readonly InputActionMap m_Unit;
private List<IUnitActions> m_UnitActionsCallbackInterfaces = new List<IUnitActions>();
private readonly InputAction m_Unit_LeftClick;
private readonly InputAction m_Unit_RightClick;
public struct UnitActions
{
private @BlueWater m_Wrapper;
public UnitActions(@BlueWater wrapper) { m_Wrapper = wrapper; }
public InputAction @LeftClick => m_Wrapper.m_Unit_LeftClick;
public InputAction @RightClick => m_Wrapper.m_Unit_RightClick;
public InputActionMap Get() { return m_Wrapper.m_Unit; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(UnitActions set) { return set.Get(); }
public void AddCallbacks(IUnitActions instance)
{
if (instance == null || m_Wrapper.m_UnitActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_UnitActionsCallbackInterfaces.Add(instance);
@LeftClick.started += instance.OnLeftClick;
@LeftClick.performed += instance.OnLeftClick;
@LeftClick.canceled += instance.OnLeftClick;
@RightClick.started += instance.OnRightClick;
@RightClick.performed += instance.OnRightClick;
@RightClick.canceled += instance.OnRightClick;
}
private void UnregisterCallbacks(IUnitActions instance)
{
@LeftClick.started -= instance.OnLeftClick;
@LeftClick.performed -= instance.OnLeftClick;
@LeftClick.canceled -= instance.OnLeftClick;
@RightClick.started -= instance.OnRightClick;
@RightClick.performed -= instance.OnRightClick;
@RightClick.canceled -= instance.OnRightClick;
}
public void RemoveCallbacks(IUnitActions instance)
{
if (m_Wrapper.m_UnitActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(IUnitActions instance)
{
foreach (var item in m_Wrapper.m_UnitActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_UnitActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public UnitActions @Unit => new UnitActions(this);
private int m_KeyboardSchemeIndex = -1;
public InputControlScheme KeyboardScheme
{
get
{
if (m_KeyboardSchemeIndex == -1) m_KeyboardSchemeIndex = asset.FindControlSchemeIndex("Keyboard");
return asset.controlSchemes[m_KeyboardSchemeIndex];
}
}
public interface IPlayerActions
{
void OnMove(InputAction.CallbackContext context);
void OnAssaultMode(InputAction.CallbackContext context);
2023-08-11 16:21:26 +00:00
void OnInteraction(InputAction.CallbackContext context);
void OnInteractionHold(InputAction.CallbackContext context);
2023-08-17 03:42:12 +00:00
void OnZkey(InputAction.CallbackContext context);
}
public interface ICameraActions
{
void OnZoom(InputAction.CallbackContext context);
void OnRotate(InputAction.CallbackContext context);
}
public interface IUnitActions
{
void OnLeftClick(InputAction.CallbackContext context);
void OnRightClick(InputAction.CallbackContext context);
}
2023-08-02 09:12:26 +00:00
}