Files
2026-03-04 10:03:45 +08:00

19 lines
486 B
C#

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