UserProperty.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. /* 本文件中包含2各类文件
  6. * UserProperty用于保存用户游戏中的相关数据
  7. * GameRunningData 保存游戏中全局的数据 */
  8. public static class UserProperty
  9. {
  10. // Start is called before the first frame update
  11. public static int userId = 1;
  12. public static string name = "任天堂";
  13. public static int coin = 1005;
  14. public static DateTime tokenExpireTime;
  15. //public static Dictionary<string, int> foods = new();
  16. //public static Dictionary<string, int> toys = new();
  17. //public static Dictionary<string, int> others = new();
  18. public static Dictionary<string, List<ItemStock>> itemStocks; // 这里dict string对应的是物品大类food, toy, other
  19. public static List<DogProperty> dogs = new();
  20. }
  21. // string id 表示具体的物品id,如food_00001
  22. // qty 表示数量
  23. public class ItemStock
  24. {
  25. public string id;
  26. public int qty;
  27. public ItemStock(string id, int qty)
  28. {
  29. this.id = id;
  30. this.qty = qty;
  31. }
  32. }
  33. // 游戏运行中的数据
  34. public static class GameRunningData
  35. {
  36. public static string focusDogId = null; // 游戏中目前游玩的dog id。
  37. }