Advertisement
Guest User

Untitled

a guest
Dec 12th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1.     internal static class CommonCacheTypeIdentifier {
  2.         private static int counter;
  3.  
  4.         static CommonCacheTypeIdentifier() => counter = -1;
  5.  
  6.         internal static int GetID() => counter++;
  7.     }
  8.    
  9.     internal static class CacheTypeIdentifier<T> where T : struct, IComponent {
  10.         public static int typeID;
  11.  
  12.         static CacheTypeIdentifier() => typeID = CommonCacheTypeIdentifier.GetID();
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement