This commit is contained in:
Mikhail 2024-04-29 17:46:32 +08:00
parent 0252f9e0a5
commit a5aadb7666
2 changed files with 11 additions and 6 deletions

View File

@ -12,7 +12,7 @@ namespace DCFApixels.DragonECS
{
#if ENABLE_IL2CPP
using Unity.IL2CPP.CompilerServices;
[Il2CppSetOption (Option.NullChecks, false)]
[Il2CppSetOption(Option.NullChecks, false)]
[Il2CppSetOption(Option.ArrayBoundsChecks, false)]
#endif
//_dense заполняется с индекса 1

View File

@ -81,17 +81,22 @@
namespace Unity.IL2CPP.CompilerServices
{
using System;
enum Option
public enum Option
{
NullChecks = 1,
ArrayBoundsChecks = 2
ArrayBoundsChecks = 2,
DivideByZeroChecks = 3,
}
[AttributeUsage (AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
class Il2CppSetOptionAttribute : Attribute
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Struct | AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Delegate, Inherited = false, AllowMultiple = true)]
public 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; }
public Il2CppSetOptionAttribute(Option option, object value)
{
Option = option;
Value = value;
}
}
}
#endif