Nenhuma descrição
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace XCharts.Runtime
  5. {
  6. /// <summary>
  7. /// Language.
  8. /// |国际化语言表。
  9. /// </summary>
  10. [Serializable]
  11. [CreateAssetMenu(menuName = "XCharts/Export Lang")]
  12. public class Lang : ScriptableObject
  13. {
  14. public string langName = "EN";
  15. public LangTime time = new LangTime();
  16. public LangCandlestick candlestick = new LangCandlestick();
  17. public string GetMonthAbbr(int month)
  18. {
  19. if (month < 1 && month > 12) return month.ToString();
  20. else return time.monthAbbr[month - 1];
  21. }
  22. public string GetDay(int day)
  23. {
  24. day = day - 1;
  25. if (day >= 0 && day < time.dayOfMonth.Count - 1)
  26. return time.dayOfMonth[day];
  27. else
  28. return day.ToString();
  29. }
  30. public string GetCandlestickDimensionName(int i)
  31. {
  32. if (i >= 0 && i < candlestick.dimensionNames.Count)
  33. return candlestick.dimensionNames[i];
  34. else
  35. return string.Empty;
  36. }
  37. }
  38. [Serializable]
  39. public class LangTime
  40. {
  41. public List<string> months = new List<string>()
  42. {
  43. "January",
  44. "February",
  45. "March",
  46. "April",
  47. "May",
  48. "June",
  49. "July",
  50. "August",
  51. "September",
  52. "October",
  53. "November",
  54. "December"
  55. };
  56. public List<string> monthAbbr = new List<string>()
  57. {
  58. "Jan",
  59. "Feb",
  60. "Mar",
  61. "Apr",
  62. "May",
  63. "Jun",
  64. "Jul",
  65. "Aug",
  66. "Sep",
  67. "Oct",
  68. "Nov",
  69. "Dec"
  70. };
  71. public List<string> dayOfMonth = new List<string>()
  72. {
  73. "1",
  74. "2",
  75. "3",
  76. "4",
  77. "5",
  78. "6",
  79. "7",
  80. "8",
  81. "9",
  82. "10",
  83. "11",
  84. "12",
  85. "13",
  86. "14",
  87. "15",
  88. "16",
  89. "17",
  90. "18",
  91. "19",
  92. "20",
  93. "21",
  94. "22",
  95. "23",
  96. "24",
  97. "25",
  98. "26",
  99. "27",
  100. "28",
  101. "29",
  102. "30",
  103. "31"
  104. };
  105. public List<string> dayOfWeek = new List<string>()
  106. {
  107. "Sunday",
  108. "Monday",
  109. "Tuesday",
  110. "Wednesday",
  111. "Thursday",
  112. "Friday",
  113. "Saturday"
  114. };
  115. public List<string> dayOfWeekAbbr = new List<string>()
  116. {
  117. "Sun",
  118. "Mon",
  119. "Tue",
  120. "Wed",
  121. "Thu",
  122. "Fri",
  123. "Sat"
  124. };
  125. }
  126. [Serializable]
  127. public class LangCandlestick
  128. {
  129. public List<string> dimensionNames = new List<string>() { "open", "close", "lowest", "highest" };
  130. }
  131. }