TestSetup.cs 1.0 KB

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