GameData.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  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. public static bool serverAliveCheckPassed = false; // 服务器存活检查是否通过
  16. #endregion
  17. #region 临时保存数据
  18. public static string subScene; // 用于指定子场景用
  19. public static string playedToy = string.Empty; // 用于暂存游戏中使用的玩具
  20. public static string bathItemId = string.Empty; // 用于暂存洗澡场景中使用的道具
  21. public static bool hasRemindedRegister = false; // 用于暂存是否已经提醒用户注册
  22. #endregion
  23. public static void SetIsVoiceTrainingToday()
  24. {
  25. isVoiceTrainingToday = true;
  26. string todayDate = System.DateTime.Now.ToString("yyyy-MM-dd");
  27. PlayerPrefs.SetString("lastTrainingDate", todayDate);
  28. PlayerPrefs.Save();
  29. }
  30. }