1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using Newtonsoft.Json;
- using System.IO;
- using UnityEngine.Networking;
- using System;
- public class EnviromentController : MonoBehaviour
- {
- // Start is called before the first frame update
- void Start()
- {
- // 读取language.json
- string filePath = EnviromentSetting.filePath;
- string json = File.ReadAllText(filePath);
- //json = Regex.Replace(json, @"[\r\n]", "");
- EnviromentSetting.languageData = JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
- // 读取系统语言
- string systemLanguage = Application.systemLanguage.ToString();
- if (systemLanguage == "ChineseSimplified")
- {
- EnviromentSetting.languageCode = "zh-cn";
- }
- // 默认语言为en
- // 读取操作系统,unique Id
- EnviromentSetting.platform = Application.platform.ToString();
- EnviromentSetting.UUID = SystemInfo.deviceUniqueIdentifier;
- // todo 开发代码,加载狗的信息,以后要移到ProgressBar页面
- DogProperty puppy_1 = new();
- EnviromentSetting.InitialPuppies(puppy_1);
- }
- // Update is called once per frame
- //void Update()
- //{
- //}
- }
|