XmlTextWriterExtensions.cs 669 B

123456789101112131415161718192021222324
  1. #if UNITY_EDITOR
  2. using UnityEngine;
  3. using System.Xml;
  4. namespace O3DWB
  5. {
  6. public static class XmlTextWriterExtensions
  7. {
  8. #region Public Static Functions
  9. public static void WriteNewLine(this XmlTextWriter writer, int indentLevel)
  10. {
  11. string text = "\n";
  12. for (int indentIndex = 0; indentIndex < indentLevel; ++indentIndex) text += "\t";
  13. writer.WriteWhitespace(text);
  14. }
  15. public static void WriteColorString(this XmlTextWriter writer, Color color)
  16. {
  17. writer.WriteString(color.r + "," + color.g + "," + color.b + "," + color.a);
  18. }
  19. #endregion
  20. }
  21. }
  22. #endif