using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using Newtonsoft.Json; using System.IO; /* 本文件包含对于狗的基础类 * DogProperty 用于描述具体某一只狗的属性配置 * DogBreed 用于描述某一种狗的数据 */ public class DogProperty { // Start is called before the first frame update public string id = "121212121"; public string name = "小泥鳅"; public int sex = 1; public string breed = "shibaInu"; // 狗的默认模型 public string skin = "black"; // 狗的默认贴图 public DateTime brithday = new(2023, 1, 1, 12, 0, 0); public int satiety = 15; public int happiness = 50; public int stamina = 29; public int thirsty = 8; public int healthy = 7; public int clean = 21; public int curiosity = 50; public int iq = 50; public int runSpeed = 50; public int JumpHeight = 50; public int liveliness = 50; public int agility = 50; public int obesity = 75; public int intimate = 50; public int friendly = 50; public int Obedience = 50; public int friendlyToHost = 50; public int friendlyToStranger = 50; public int friendlyToOtherSSDog = 50; public int friendlyToOtherDSDog = 50; public int frisbeeSkill = 50; public int ballSkill = 50; public int AIName = 50; public int AISit = 50; public int AILieDown = 50; public int AIRotate = 50; } public class DogBreed { public string breed { get; set; } public Dictionary name { get; set; } public Dictionary description { get; set; } public DateTime createDate { get; set; } public DateTime lastDpdate { get; set; } public int cost { get; set; } public string prefab { get; set; } public string[] skin { get; set; } } public class DogBreedController { // 读取狗的数据并放入EnviromentSetting.dogBreeds public static void LoadDogBreed() { string filePath = EnviromentSetting.dogDBFilePath; string json = File.ReadAllText(filePath); Dictionary dogDB = JsonConvert.DeserializeObject>(json); string json2 = dogDB["dogDB"].ToString(); EnviromentSetting.dogBreeds = JsonConvert.DeserializeObject(json2); } }