blob: 5914c44f9a854026ea858b481a8b1231c3581c0a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
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);
}
}
|