Extensions.cs 957 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using UnityEngine;
  2. using System.Collections;
  3. using System;
  4. namespace LitJson.Extensions {
  5. /// <summary>
  6. /// 拓展方法
  7. /// </summary>
  8. public static class Extensions {
  9. public static void WriteProperty(this JsonWriter w,string name,long value){
  10. w.WritePropertyName(name);
  11. w.Write(value);
  12. }
  13. public static void WriteProperty(this JsonWriter w,string name,string value){
  14. w.WritePropertyName(name);
  15. w.Write(value);
  16. }
  17. public static void WriteProperty(this JsonWriter w,string name,bool value){
  18. w.WritePropertyName(name);
  19. w.Write(value);
  20. }
  21. public static void WriteProperty(this JsonWriter w,string name,double value){
  22. w.WritePropertyName(name);
  23. w.Write(value);
  24. }
  25. }
  26. /// <summary>
  27. /// 跳过序列化的标签
  28. /// </summary>
  29. [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)]
  30. public sealed class JsonIgnore : Attribute
  31. {
  32. }
  33. }