Skip to content

Commit 6dd0f88

Browse files
committed
Replaced Conditional by preprocessor check since Conditional cannot work since referencing editor types.
1 parent 8f826ca commit 6dd0f88

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Packages/com.unity.inputsystem/InputSystem/Actions/InputActionReference.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ public InputAction ToInputAction()
253253
/// </remarks>
254254
/// <exception cref="InvalidOperationException">Thrown if this input action reference is part of an
255255
/// input actions asset and mutating it would have side-effects on the projects assets.</exception>
256-
[System.Diagnostics.Conditional("UNITY_EDITOR")]
257256
private void CheckImmutableReference()
258257
{
258+
#if UNITY_EDITOR
259259
// Note that we do a lot of checking here, but it is only for a rather slim (unintended) use case in
260260
// editor and not in final builds. The alternative would be to set a non-serialized field on the reference
261261
// when importing assets which would simplify this class, but it adds complexity to import stage and
@@ -300,6 +300,7 @@ static bool CanSetReference(InputActionReference reference)
300300
"in-memory instance or serialize it as a separate asset if it " +
301301
"survive domain reloads.");
302302
}
303+
#endif // UNITY_EDITOR
303304
}
304305
}
305306
}

0 commit comments

Comments
 (0)