using System; using UnityEngine; public class TestSetup : MonoBehaviour { void Awake() { // 初始化狗数据用于测试 DogProperty puppy = new DogProperty(); UserProperty.dogs.Clear(); UserProperty.dogs.Add(puppy); UserProperty.food.Add(new Item("food_00001", 10)); UserProperty.food.Add(new Item("food_00002", 20)); UserProperty.food.Add(new Item("food_00003", 30)); UserProperty.food.Add(new Item("water_00001", 999)); if (EnviromentSetting.languageData == null) { EnviromentController.InitialGameEnviroment(); } } // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { } // todo 删除。测试假数据注入 void TestDataInjection() { PlayerPrefs.SetString("LoginToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiSlRZTlpQOU8iLCJleHAiOjE3NDAxOTQ2Nzl9.081FF2AwxDTsN1gDWGZuzOxIDbM4M8Dw-mdwLfkxk4A"); DateTime now = DateTime.Now; DateTime oneHourAgo = now.AddHours(-1); PlayerPrefs.SetString("LoginTokenTime", oneHourAgo.ToString()); } // Update is called once per frame // void Update() // { // } }