CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

CallbackIdentity.cs (1272B)


      1 // This file is provided under The MIT License as part of Steamworks.NET.
      2 // Copyright (c) 2013-2019 Riley Labrecque
      3 // Please see the included LICENSE.txt for additional information.
      4 
      5 // This file is automatically generated.
      6 // Changes to this file will be reverted when you update Steamworks.NET
      7 
      8 #if UNITY_ANDROID || UNITY_IOS || UNITY_TIZEN || UNITY_TVOS || UNITY_WEBGL || UNITY_WSA || UNITY_PS4 || UNITY_WII || UNITY_XBOXONE || UNITY_SWITCH
      9 #define DISABLESTEAMWORKS
     10 #endif
     11 
     12 #if !DISABLESTEAMWORKS
     13 
     14 namespace Steamworks {
     15 	class CallbackIdentities {
     16 		public static int GetCallbackIdentity(System.Type callbackStruct) {
     17 #if UNITY_EDITOR || UNITY_STANDALONE || STEAMWORKS_WIN || STEAMWORKS_LIN_OSX
     18 			foreach (CallbackIdentityAttribute attribute in callbackStruct.GetCustomAttributes(typeof(CallbackIdentityAttribute), false)) {
     19 				return attribute.Identity;
     20 			}
     21 #endif
     22 			throw new System.Exception("Callback number not found for struct " + callbackStruct);
     23 		}
     24 	}
     25 
     26 	[System.AttributeUsage(System.AttributeTargets.Struct, AllowMultiple = false)]
     27 	internal class CallbackIdentityAttribute : System.Attribute {
     28 		public int Identity { get; set; }
     29 		public CallbackIdentityAttribute(int callbackNum) {
     30 			Identity = callbackNum;
     31 		}
     32 	}
     33 }
     34 
     35 #endif // !DISABLESTEAMWORKS