37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
|
using System;
|
|||
|
using System.Runtime.CompilerServices;
|
|||
|
using Unity.IL2CPP.CompilerServices;
|
|||
|
|
|||
|
namespace AlicizaX
|
|||
|
{
|
|||
|
public interface IEventArgs { }
|
|||
|
|
|||
|
[AttributeUsage(AttributeTargets.Struct)]
|
|||
|
public sealed class PrewarmAttribute : Attribute
|
|||
|
{
|
|||
|
public int Capacity { get; }
|
|||
|
public PrewarmAttribute(int capacity) => Capacity = capacity;
|
|||
|
}
|
|||
|
|
|||
|
[Il2CppSetOption(Option.NullChecks, false)]
|
|||
|
[Il2CppSetOption(Option.DivideByZeroChecks, false)]
|
|||
|
[Il2CppSetOption(Option.ArrayBoundsChecks, false)]
|
|||
|
public readonly struct EventRuntimeHandle
|
|||
|
{
|
|||
|
private readonly Action<int,int> _unsubscribe;
|
|||
|
private readonly int _index;
|
|||
|
private readonly int _version;
|
|||
|
|
|||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|||
|
public EventRuntimeHandle(Action<int,int> unsubscribe, int index, int version)
|
|||
|
{
|
|||
|
_unsubscribe = unsubscribe;
|
|||
|
_index = index;
|
|||
|
_version = version;
|
|||
|
}
|
|||
|
|
|||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|||
|
public void Dispose() => _unsubscribe?.Invoke(_index, _version);
|
|||
|
}
|
|||
|
}
|