GameData.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. /* 存放游戏运行中一些保存的数据
  2. */
  3. using System;
  4. using System.Net.NetworkInformation;
  5. using UnityEngine;
  6. public static class GameData
  7. {
  8. #region 游戏运行数据
  9. public static int focusDog = 0; // 游戏中目前玩家主要玩的狗,便于UserProperty.dogs[focusDog]和dogsInScene[focusDog]的使用
  10. public static int homeCamFocusDog = 100; // Home场景下,摄像机聚焦的狗。100表示不聚焦任何的狗
  11. public static bool isVoiceTrainingToday; // 是否今天已经进行过语音训练
  12. // public static bool isFirstInteraction = true; // 是否第一次互动
  13. public static DateTime lastFeedbackTime = new DateTime(2000, 1, 1); // 上次反馈的时间
  14. public static float noteStartLeadTime = 4f; // 音符提前创建的时间
  15. #endregion
  16. #region 临时保存数据
  17. public static string subScene; // 用于指定子场景用
  18. public static string playedToy = string.Empty; // 用于暂存游戏中使用的玩具
  19. public static string bathItemId = string.Empty; // 用于暂存洗澡场景中使用的道具
  20. public static bool hasRemindedRegister = false; // 用于暂存是否已经提醒用户注册
  21. #endregion
  22. public static void SetIsVoiceTrainingToday()
  23. {
  24. isVoiceTrainingToday = true;
  25. string todayDate = System.DateTime.Now.ToString("yyyy-MM-dd");
  26. PlayerPrefs.SetString("lastTrainingDate", todayDate);
  27. PlayerPrefs.Save();
  28. }
  29. }