UserProperty.cs 1.1 KB

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