Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ public struct ControlBuilder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder At(InputDevice device, int index)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (device == null)
throw new ArgumentNullException(nameof(device));
if (index < 0 || index >= device.m_ChildrenForEachControl.Length)
Expand All @@ -1630,7 +1630,7 @@ public ControlBuilder At(InputDevice device, int index)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder WithParent(InputControl parent)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (parent == null)
throw new ArgumentNullException(nameof(parent));
if (parent == control)
Expand All @@ -1643,7 +1643,7 @@ public ControlBuilder WithParent(InputControl parent)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder WithName(string name)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (string.IsNullOrEmpty(name))
throw new ArgumentNullException(nameof(name));
#endif
Expand All @@ -1654,7 +1654,7 @@ public ControlBuilder WithName(string name)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder WithDisplayName(string displayName)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (string.IsNullOrEmpty(displayName))
throw new ArgumentNullException(nameof(displayName));
#endif
Expand All @@ -1665,7 +1665,7 @@ public ControlBuilder WithDisplayName(string displayName)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder WithShortDisplayName(string shortDisplayName)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (string.IsNullOrEmpty(shortDisplayName))
throw new ArgumentNullException(nameof(shortDisplayName));
#endif
Expand All @@ -1676,7 +1676,7 @@ public ControlBuilder WithShortDisplayName(string shortDisplayName)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder WithLayout(InternedString layout)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (layout.IsEmpty())
throw new ArgumentException("Layout name cannot be empty", nameof(layout));
#endif
Expand All @@ -1687,7 +1687,7 @@ public ControlBuilder WithLayout(InternedString layout)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder WithUsages(int startIndex, int count)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (startIndex < 0 || startIndex >= control.device.m_UsagesForEachControl.Length)
throw new ArgumentOutOfRangeException(nameof(startIndex));
if (count < 0 || startIndex + count > control.device.m_UsagesForEachControl.Length)
Expand All @@ -1701,7 +1701,7 @@ public ControlBuilder WithUsages(int startIndex, int count)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder WithAliases(int startIndex, int count)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (startIndex < 0 || startIndex >= control.device.m_AliasesForEachControl.Length)
throw new ArgumentOutOfRangeException(nameof(startIndex));
if (count < 0 || startIndex + count > control.device.m_AliasesForEachControl.Length)
Expand All @@ -1715,7 +1715,7 @@ public ControlBuilder WithAliases(int startIndex, int count)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public ControlBuilder WithChildren(int startIndex, int count)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (startIndex < 0 || startIndex >= control.device.m_ChildrenForEachControl.Length)
throw new ArgumentOutOfRangeException(nameof(startIndex));
if (count < 0 || startIndex + count > control.device.m_ChildrenForEachControl.Length)
Expand Down Expand Up @@ -1754,7 +1754,7 @@ public ControlBuilder WithProcessor<TProcessor, TValue>(TProcessor processor)
where TValue : struct
where TProcessor : InputProcessor<TValue>
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (processor == null)
throw new ArgumentNullException(nameof(processor));
#endif
Expand Down Expand Up @@ -1808,7 +1808,7 @@ public struct DeviceBuilder
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DeviceBuilder WithName(string name)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (string.IsNullOrEmpty(name))
throw new ArgumentNullException(nameof(name));
#endif
Expand All @@ -1819,7 +1819,7 @@ public DeviceBuilder WithName(string name)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DeviceBuilder WithDisplayName(string displayName)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (string.IsNullOrEmpty(displayName))
throw new ArgumentNullException(nameof(displayName));
#endif
Expand All @@ -1830,7 +1830,7 @@ public DeviceBuilder WithDisplayName(string displayName)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DeviceBuilder WithShortDisplayName(string shortDisplayName)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (string.IsNullOrEmpty(shortDisplayName))
throw new ArgumentNullException(nameof(shortDisplayName));
#endif
Expand All @@ -1841,7 +1841,7 @@ public DeviceBuilder WithShortDisplayName(string shortDisplayName)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DeviceBuilder WithLayout(InternedString layout)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (layout.IsEmpty())
throw new ArgumentException("Layout name cannot be empty", nameof(layout));
#endif
Expand All @@ -1852,7 +1852,7 @@ public DeviceBuilder WithLayout(InternedString layout)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DeviceBuilder WithChildren(int startIndex, int count)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (startIndex < 0 || startIndex >= device.device.m_ChildrenForEachControl.Length)
throw new ArgumentOutOfRangeException(nameof(startIndex));
if (count < 0 || startIndex + count > device.device.m_ChildrenForEachControl.Length)
Expand Down Expand Up @@ -1880,7 +1880,7 @@ public DeviceBuilder IsNoisy(bool value)
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DeviceBuilder WithControlUsage(int controlIndex, InternedString usage, InputControl control)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (controlIndex < 0 || controlIndex >= device.m_UsagesForEachControl.Length)
throw new ArgumentOutOfRangeException(nameof(controlIndex));
if (usage.IsEmpty())
Expand All @@ -1896,7 +1896,7 @@ public DeviceBuilder WithControlUsage(int controlIndex, InternedString usage, In
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public DeviceBuilder WithControlAlias(int controlIndex, InternedString alias)
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
if (controlIndex < 0 || controlIndex >= device.m_AliasesForEachControl.Length)
throw new ArgumentOutOfRangeException(nameof(controlIndex));
if (alias.IsEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace UnityEngine.InputSystem
/// </remarks>
/// <typeparam name="TControl">Type of <see cref="InputControl"/> to store in the list.</typeparam>
[DebuggerDisplay("Count = {Count}")]
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
[DebuggerTypeProxy(typeof(InputControlListDebugView<>))]
#endif
public unsafe struct InputControlList<TControl> : IList<TControl>, IReadOnlyList<TControl>, IDisposable
Expand Down Expand Up @@ -597,7 +597,7 @@ public void Dispose()
}
}

#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
internal struct InputControlListDebugView<TControl>
where TControl : InputControl
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ private static TData DeserializeData<TData>(byte[] data)
return JsonUtility.FromJson<TData>(json);
}

#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
// State we want to take across domain reloads. We can only take some of the
// state across. Subscriptions will be lost and have to be manually restored.
[Serializable]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ internal void AdvanceToNextEvent(ref InputEvent* currentReadPos,
if (numRemainingEvents > 1)
{
// Don't perform safety check in non-debug builds.
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
newReadPos = InputEvent.GetNextInMemoryChecked(currentReadPos, ref this);
#else
newReadPos = InputEvent.GetNextInMemory(currentReadPos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4481,7 +4481,7 @@ private bool FlipBuffersForDeviceIfNecessary(InputDevice device, InputUpdateType

// Stuff everything that we want to survive a domain reload into
// a m_SerializedState.
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
[Serializable]
internal struct DeviceState
{
Expand Down Expand Up @@ -4795,6 +4795,6 @@ private bool RestoreDeviceFromSavedState(ref DeviceState deviceState, InternedSt
return true;
}

#endif // UNITY_EDITOR || DEVELOPMENT_BUILD
#endif // DEBUG
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3366,7 +3366,7 @@ public static bool runInBackground
internal static InputManager s_Manager;
internal static InputRemoting s_Remote;

#if DEVELOPMENT_BUILD || UNITY_EDITOR
#if DEBUG
private static RemoteInputPlayerConnection s_RemoteConnection;

internal static RemoteInputPlayerConnection remoteConnection
Expand Down Expand Up @@ -3410,8 +3410,8 @@ private static bool ShouldEnableRemoting()
#endif
}

#endif //!UNITY_EDITOR
#endif // DEVELOPMENT_BUILD || UNITY_EDITOR
#endif //!UNITY_EDITOR //
#endif // DEBUG

// The rest here is internal stuff to manage singletons, survive domain reloads,
// and to support the reset ability for tests.
Expand Down Expand Up @@ -3506,7 +3506,7 @@ internal static void InitializeInPlayer(IInputRuntime runtime = null, bool loadS
#endif

// Automatically enable remoting in development players.
#if DEVELOPMENT_BUILD
#if DEBUG && !UNITY_EDITOR
if (ShouldEnableRemoting())
SetUpRemoting();
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace UnityEngine.InputSystem
{
#if UNITY_EDITOR || DEVELOPMENT_BUILD
#if DEBUG
/// <summary>
/// Snapshot of the state used by the input system.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private static void OnBeforeDomainReload()

#endif

[Conditional("DEVELOPMENT_BUILD")]
[Conditional("DEBUG")]
[Conditional("UNITY_EDITOR")]
internal static void CheckEnabled()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ private class HIDLayoutBuilder
public string displayName;
public HIDDeviceDescriptor hidDescriptor;
public string parentLayout;
[NonSerialized]
public Type deviceType;

public InputControlLayout Build()
Expand Down Expand Up @@ -517,7 +518,9 @@ public struct HIDElementDescriptor
public HIDElementFlags flags;

// Fields only relevant to arrays.
[NonSerialized]
public int? usageMin;
[NonSerialized]
public int? usageMax;

public bool hasNullState => (flags & HIDElementFlags.NullState) == HIDElementFlags.NullState;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ private bool IsDeviceUsableWithPlayerActions(InputDevice device)

private void ValidateInputActionAsset()
{
#if DEVELOPMENT_BUILD || UNITY_EDITOR
#if DEBUG
if (m_PlayerPrefab == null || m_PlayerPrefab.GetComponentInChildren<PlayerInput>() == null)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ private static void MigrateDoubleBuffer(DoubleBuffers newBuffer, InputDevice[] d
// NOTE: This also means that device indices of
if (device.m_StateBlock.byteOffset == InputStateBlock.InvalidOffset)
{
#if DEVELOPMENT_BUILD || UNITY_EDITOR
#if DEBUG
for (var n = i + 1; n < deviceCount; ++n)
Debug.Assert(devices[n].m_StateBlock.byteOffset == InputStateBlock.InvalidOffset,
"New devices must be appended to the array; found an old device coming in the array after a newly added device");
Expand Down
Loading