Skip to content

Commit 3ba309e

Browse files
wiweikeveleigh
authored andcommitted
Update the MixedRealityExtensionServiceAttribute to be entirely hidden behind the UNITY_EDITOR check.
The entire function is only ever invoked from a UNITY_EDITOR context, so there's no reason to do any null stuff. This is better in that it will also catch compile-time issues (rather than lead to runtime null problems).
1 parent f74177d commit 3ba309e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Assets/MixedRealityToolkit/Attributes/MixedRealityExtensionServiceAttribute.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,17 @@ public MixedRealityExtensionServiceAttribute(
7474
PackageFolder = packageFolder;
7575
}
7676

77+
#if UNITY_EDITOR
7778
/// <summary>
7879
/// Convenience function for retrieving the attribute given a certain class type.
7980
/// </summary>
81+
/// <remarks>
82+
/// This function is only available in a UnityEditor context.
83+
/// </remarks>
8084
public static MixedRealityExtensionServiceAttribute Find(Type type)
8185
{
8286
return type.GetCustomAttributes(typeof(MixedRealityExtensionServiceAttribute), true).FirstOrDefault() as MixedRealityExtensionServiceAttribute;
8387
}
88+
#endif // UNITY_EDITOR
8489
}
8590
}

0 commit comments

Comments
 (0)