// Use this for initialization static void Initial() { List <Tax> _psList = new List <Tax>(); Tax _tax = new Tax(); _tax.platformName = Platforms.p19800; _tax.coinName = Coins.BTC; _tax.sellTax = 0.001f; _tax.buyTax = 0.001f; _psList.Add(_tax); Tax _tax1 = new Tax(); _tax1.platformName = Platforms.p19800; _tax1.coinName = Coins.ETH; _tax1.sellTax = 0.001f; _tax1.buyTax = 0.001f; _psList.Add(_tax1); string _json = JsonConvert.SerializeObject(_psList); Debug.Log(_json); CommonTool.CreateFile(Application.persistentDataPath, "TaxSettings.json", _json); Debug.Log(CommonTool.ReadFile(Application.persistentDataPath, "TaxSettings.json")); }
// Use this for initialization static void InitialPlatformSetting() { List <PlatformSetting> _psList = new List <PlatformSetting>(); PlatformSetting _ps19800 = new PlatformSetting(); _ps19800.platformName = "19800"; _ps19800.key = "1"; _ps19800.security = "4"; _psList.Add(_ps19800); PlatformSetting _psjubi = new PlatformSetting(); _psjubi.platformName = "jubi"; _psjubi.key = "1"; _psjubi.security = "4"; _psList.Add(_psjubi); string _json = JsonConvert.SerializeObject(_psList); Debug.Log(_json); CommonTool.CreateFile(Application.persistentDataPath, "platformSettings.json", _json); Debug.Log(CommonTool.ReadFile(Application.persistentDataPath, "platformSettings.json")); }