Skip to content

Commit 45007fa

Browse files
committed
Add [Conditional("UNITY_EDITOR")] attribute to all Inspector attributes
1 parent c2d7015 commit 45007fa

72 files changed

Lines changed: 148 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/AssetPreviewAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -8,6 +9,7 @@ namespace UnityEngine
89
/// <para>Supported types: any <see cref="Object"/>.</para>
910
/// </summary>
1011
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
12+
[Conditional("UNITY_EDITOR")]
1113
public class AssetPreviewAttribute : PropertyAttribute
1214
{
1315
public AssetPreviewAttribute(float width = 64, float height = 64, bool useLabel = true)

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/ChildObjectOnlyAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -8,6 +9,7 @@ namespace UnityEngine
89
/// <para>Supported types: <see cref="GameObject"/> and any <see cref="Component"/>.</para>
910
/// </summary>
1011
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
12+
[Conditional("UNITY_EDITOR")]
1113
public class ChildObjectOnlyAttribute : PropertyAttribute
1214
{ }
1315
}

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/ClampAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -8,6 +9,7 @@ namespace UnityEngine
89
/// <para>Supported types: <see cref="int"/>, <see cref="float"/>, <see cref="double"/>.</para>
910
/// </summary>
1011
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
12+
[Conditional("UNITY_EDITOR")]
1113
public class ClampAttribute : PropertyAttribute
1214
{
1315
public ClampAttribute(float minValue, float maxValue)

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/DirectoryAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -8,6 +9,7 @@ namespace UnityEngine
89
/// <para>Supported types: <see cref="string"/>.</para>
910
/// </summary>
1011
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
12+
[Conditional("UNITY_EDITOR")]
1113
public class DirectoryAttribute : PropertyAttribute
1214
{
1315
/// <param name="relativePath">Relative path from ProjectName/Assets directory</param>

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/EnumFlagAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -9,6 +10,7 @@ namespace UnityEngine
910
/// </summary>
1011
[Obsolete("Use EnumTogglesAttribute instead.")]
1112
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
13+
[Conditional("UNITY_EDITOR")]
1214
public class EnumFlagAttribute : PropertyAttribute
1315
{
1416
public EnumFlagAttribute(EnumStyle style = EnumStyle.Popup)

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/EnumTogglesAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -8,6 +9,7 @@ namespace UnityEngine
89
/// <para>Supported types: any <see cref="Enum"/>.</para>
910
/// </summary>
1011
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
12+
[Conditional("UNITY_EDITOR")]
1113
public class EnumTogglesAttribute : PropertyAttribute
1214
{
1315
/// <summary>

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/FormattedNumberAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -15,6 +16,7 @@ namespace UnityEngine
1516
/// <para>Supported types: <see cref="int"/>, <see cref="float"/>, <see cref="double"/>.</para>
1617
/// </summary>
1718
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
19+
[Conditional("UNITY_EDITOR")]
1820
public class FormattedNumberAttribute : PropertyAttribute
1921
{
2022
public FormattedNumberAttribute(string format = "n")

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/HideLabelAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -8,6 +9,7 @@ namespace UnityEngine
89
/// <para>Supported types: all.</para>
910
/// </summary>
1011
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
12+
[Conditional("UNITY_EDITOR")]
1113
public class HideLabelAttribute : PropertyAttribute
1214
{ }
1315
}

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/LabelByChildAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -20,6 +21,7 @@ namespace UnityEngine
2021
/// <para>Supported types: any type with children.</para>
2122
/// </summary>
2223
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
24+
[Conditional("UNITY_EDITOR")]
2325
public class LabelByChildAttribute : PropertyAttribute
2426
{
2527
public LabelByChildAttribute(string childName)

Assets/Editor Toolbox/Scripts/Attributes/RegularAttributes/LayerAttribute.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Diagnostics;
23

34
namespace UnityEngine
45
{
@@ -8,6 +9,7 @@ namespace UnityEngine
89
/// <para>Supported types: <see cref="int"/>.</para>
910
/// </summary>
1011
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
12+
[Conditional("UNITY_EDITOR")]
1113
public class LayerAttribute : PropertyAttribute
1214
{ }
1315
}

0 commit comments

Comments
 (0)