SimpleNumericString.cs 693 B

1234567891011121314151617181920212223242526272829303132
  1. using UnityEngine;
  2. using System.Collections;
  3. public static class SimpleNumericString
  4. {
  5. private static string[] RawString = new string[240];
  6. private static bool bIsInitialized = false;
  7. private static void Init()
  8. {
  9. for (int i = 0; i < RawString.Length; ++i)
  10. {
  11. RawString[i] = string.Format("{0}", i);
  12. }
  13. }
  14. public static string GetNumeric(int InValue)
  15. {
  16. if (!bIsInitialized)
  17. {
  18. bIsInitialized = true;
  19. Init();
  20. }
  21. if (InValue >= 0 && InValue < RawString.Length)
  22. {
  23. return RawString[InValue];
  24. }
  25. return string.Format("{0}", InValue);
  26. }
  27. }