ProtobufInit.cs 506 B

1234567891011121314151617181920
  1. using System;
  2. using ProtoBuf;
  3. namespace ET
  4. {
  5. public static class ProtobufInit
  6. {
  7. public static void Init()
  8. {
  9. foreach (Type type in Game.EventSystem.GetTypes().Values)
  10. {
  11. if (type.GetCustomAttributes(typeof(ProtoContractAttribute), false).Length == 0 && type.GetCustomAttributes(typeof(ProtoMemberAttribute), false).Length == 0)
  12. {
  13. continue;
  14. }
  15. PType.RegisterType(type.FullName, type);
  16. }
  17. }
  18. }
  19. }