diff --git a/src/Consts.cs b/src/Consts.cs index d3b54a4..2723d4e 100644 --- a/src/Consts.cs +++ b/src/Consts.cs @@ -72,3 +72,24 @@ //#if UNITY_2020_3_OR_NEWER // [UnityEngine.Scripting.RequireDerived, UnityEngine.Scripting.Preserve] //#endif + + + + +#if ENABLE_IL2CPP +// Unity IL2CPP performance optimization attribute. +namespace Unity.IL2CPP.CompilerServices { + enum Option { + NullChecks = 1, + ArrayBoundsChecks = 2 + } + + [AttributeUsage (AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] + class Il2CppSetOptionAttribute : Attribute { + public Option Option { get; private set; } + public object Value { get; private set; } + + public Il2CppSetOptionAttribute (Option option, object value) { Option = option; Value = value; } + } +} +#endif \ No newline at end of file