Files
2026-02-21 16:45:37 +08:00

20 lines
560 B
C#

using System;
namespace Steamworks
{
internal class CallbackIdentities
{
public static int GetCallbackIdentity(Type callbackStruct)
{
object[] customAttributes = callbackStruct.GetCustomAttributes(typeof(CallbackIdentityAttribute), false);
int num = 0;
if (num < customAttributes.Length)
{
CallbackIdentityAttribute callbackIdentityAttribute = (CallbackIdentityAttribute)customAttributes[num];
return callbackIdentityAttribute.Identity;
}
throw new Exception("Callback number not found for struct " + callbackStruct);
}
}
}