using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEditorInternal; using System.Text.RegularExpressions; using Newtonsoft.Json; public static class EnviromentSetting { // 服务器ip public const string serverIp = "101.34.23.118"; //language.json读取 public static string filePath = "Assets/Resources/Data/languages.json"; public static Dictionary languageData = new(); // access Token public static string accessToken; //系统语言 default=en public static string languageCode = "en"; //操作系统 public static string platform = "NA"; // Unity Unique Id public static string UUID = string.Empty; //多个宠物的列表 public static List puppies = new(); // 开发阶段代码,加载宠物 public static void InitialPuppies(DogProperty puppy) { puppies.Add(puppy); } //用于获取多层级Dictionary中的value public static string GetValueAtPath(Dictionary root, string[] path) { Dictionary current = root; int count = 0; foreach (string key in path) { string rawValue = current[key].ToString(); rawValue = Regex.Replace(rawValue, @"[\r\n]", ""); if (count == path.Length-1) { return rawValue; } Dictionary value = JsonConvert.DeserializeObject>(rawValue); current = value; count++; } return null; } }