TestSetup.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using UnityEngine;
  3. public class TestSetup : MonoBehaviour
  4. {
  5. void Awake()
  6. {
  7. // 初始化狗数据用于测试
  8. DogProperty puppy = new DogProperty();
  9. puppy.runSpeed = 100;
  10. puppy.skin = "yellow";
  11. UserProperty.dogs.Add(puppy);
  12. if (EnviromentSetting.languageData == null)
  13. {
  14. EnviromentController.InitialGameEnviroment();
  15. }
  16. }
  17. // Start is called once before the first execution of Update after the MonoBehaviour is created
  18. void Start()
  19. {
  20. }
  21. // todo 删除。测试假数据注入
  22. void TestDataInjection()
  23. {
  24. PlayerPrefs.SetString("LoginToken", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiSlRZTlpQOU8iLCJleHAiOjE3NDAxOTQ2Nzl9.081FF2AwxDTsN1gDWGZuzOxIDbM4M8Dw-mdwLfkxk4A");
  25. DateTime now = DateTime.Now;
  26. DateTime oneHourAgo = now.AddHours(-1);
  27. PlayerPrefs.SetString("LoginTokenTime", oneHourAgo.ToString());
  28. }
  29. // Update is called once per frame
  30. // void Update()
  31. // {
  32. // }
  33. }