ObjectExtension.cs 629 B

123456789101112131415161718192021222324252627
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. namespace WXB
  6. {
  7. public static class ObjectExtension
  8. {
  9. public static StringBuilder AppendLine(this StringBuilder sb, string value, params string[] args)
  10. {
  11. return sb.AppendLine(string.Format(value, args));
  12. }
  13. public static T pop_back<T>(this List<T> l)
  14. {
  15. T t = l[l.Count - 1];
  16. l.RemoveAt(l.Count - 1);
  17. return t;
  18. }
  19. public static T back<T>(this List<T> l)
  20. {
  21. return l[l.Count - 1];
  22. }
  23. }
  24. }