Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

96 lignes
2.6 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using SUISS.Core;
  4. using UnityEngine;
  5. namespace SUISSEngine
  6. {
  7. [Serializable]
  8. public class PlatformDependentSettings
  9. {
  10. public PlatformDependentSettings(List<string> keys)
  11. {
  12. this._keys = new List<string>();
  13. this._values = new List<string>();
  14. this._iosValues = new List<string>();
  15. this._androidValues = new List<string>();
  16. this._chineseValues = new List<string>();
  17. this._windowsStoreValues = new List<string>();
  18. this._cafeBazaarValues = new List<string>();
  19. this._amazonValues = new List<string>();
  20. this._osxStoreValues = new List<string>();
  21. foreach (string item in keys)
  22. {
  23. this._keys.Add(item);
  24. this._values.Add(string.Empty);
  25. this._iosValues.Add(string.Empty);
  26. this._androidValues.Add(string.Empty);
  27. this._chineseValues.Add(string.Empty);
  28. this._windowsStoreValues.Add(string.Empty);
  29. this._cafeBazaarValues.Add(string.Empty);
  30. this._amazonValues.Add(string.Empty);
  31. this._osxStoreValues.Add(string.Empty);
  32. }
  33. }
  34. protected IGameInterface gameInterface
  35. {
  36. get
  37. {
  38. if (this._gameInterface == null)
  39. {
  40. this._gameInterface = ServiceLocator.Find<IGameInterface>();
  41. }
  42. return this._gameInterface;
  43. }
  44. }
  45. public string GetSetting(string key)
  46. {
  47. int num = this._keys.FindIndex((string match) => match.Equals(key));
  48. if (this.gameInterface.GetCountryCode().ToLower() == "cn" && num >= 0 && num < this._chineseValues.Count && !string.IsNullOrEmpty(this._chineseValues[num]))
  49. {
  50. return this._chineseValues[num];
  51. }
  52. if (num >= 0 && num < this._androidValues.Count && !string.IsNullOrEmpty(this._androidValues[num]))
  53. {
  54. return this._androidValues[num];
  55. }
  56. if (num >= 0 && num < this._values.Count && !string.IsNullOrEmpty(this._values[num]))
  57. {
  58. return this._values[num];
  59. }
  60. return string.Empty;
  61. }
  62. private IGameInterface _gameInterface;
  63. [SerializeField]
  64. private List<string> _iosValues = new List<string>();
  65. [SerializeField]
  66. private List<string> _androidValues = new List<string>();
  67. [SerializeField]
  68. private List<string> _chineseValues = new List<string>();
  69. [SerializeField]
  70. private List<string> _windowsStoreValues = new List<string>();
  71. [SerializeField]
  72. private List<string> _cafeBazaarValues = new List<string>();
  73. [SerializeField]
  74. private List<string> _amazonValues = new List<string>();
  75. [SerializeField]
  76. private List<string> _osxStoreValues = new List<string>();
  77. [SerializeField]
  78. private List<string> _values = new List<string>();
  79. [SerializeField]
  80. private List<string> _keys;
  81. }
  82. }