using System; using System.Collections.Generic; using SUISS.Core; using UnityEngine; namespace SUISSEngine { [Serializable] public class PlatformDependentSettings { public PlatformDependentSettings(List keys) { this._keys = new List(); this._values = new List(); this._iosValues = new List(); this._androidValues = new List(); this._chineseValues = new List(); this._windowsStoreValues = new List(); this._cafeBazaarValues = new List(); this._amazonValues = new List(); this._osxStoreValues = new List(); foreach (string item in keys) { this._keys.Add(item); this._values.Add(string.Empty); this._iosValues.Add(string.Empty); this._androidValues.Add(string.Empty); this._chineseValues.Add(string.Empty); this._windowsStoreValues.Add(string.Empty); this._cafeBazaarValues.Add(string.Empty); this._amazonValues.Add(string.Empty); this._osxStoreValues.Add(string.Empty); } } protected IGameInterface gameInterface { get { if (this._gameInterface == null) { this._gameInterface = ServiceLocator.Find(); } return this._gameInterface; } } public string GetSetting(string key) { int num = this._keys.FindIndex((string match) => match.Equals(key)); if (this.gameInterface.GetCountryCode().ToLower() == "cn" && num >= 0 && num < this._chineseValues.Count && !string.IsNullOrEmpty(this._chineseValues[num])) { return this._chineseValues[num]; } if (num >= 0 && num < this._androidValues.Count && !string.IsNullOrEmpty(this._androidValues[num])) { return this._androidValues[num]; } if (num >= 0 && num < this._values.Count && !string.IsNullOrEmpty(this._values[num])) { return this._values[num]; } return string.Empty; } private IGameInterface _gameInterface; [SerializeField] private List _iosValues = new List(); [SerializeField] private List _androidValues = new List(); [SerializeField] private List _chineseValues = new List(); [SerializeField] private List _windowsStoreValues = new List(); [SerializeField] private List _cafeBazaarValues = new List(); [SerializeField] private List _amazonValues = new List(); [SerializeField] private List _osxStoreValues = new List(); [SerializeField] private List _values = new List(); [SerializeField] private List _keys; } }