UserProperty.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 string userId;
  12. public static string name = "任天堂";
  13. public static int coin = 1005;
  14. public static string email, mobile, level;
  15. public static bool isRegUser = false;
  16. //public static Dictionary<string, int> foods = new();
  17. //public static Dictionary<string, int> toys = new();
  18. //public static Dictionary<string, int> others = new();
  19. public static Dictionary<string, List<ItemStock>> itemStocks; // 这里dict string对应的是物品大类food, toy, other
  20. public static List<DogProperty> dogs = new();
  21. }
  22. // string id 表示具体的物品id,如food_00001
  23. // qty 表示数量
  24. public class ItemStock
  25. {
  26. public string id;
  27. public int qty;
  28. public ItemStock(string id, int qty)
  29. {
  30. this.id = id;
  31. this.qty = qty;
  32. }
  33. }
  34. // 游戏运行中的数据
  35. public static class GameRunningData
  36. {
  37. public static string focusDogId = null; // 游戏中目前游玩的dog id。
  38. }