예제 #1
0
 void Awake()
 {
     if (m_Instance)
         Destroy(gameObject);
     else
     {
         m_Instance = this;
         DontDestroyOnLoad(gameObject);
         if (PlayerPrefs.HasKey(m_LastPhysicalKey))
         {
             ConstantData.physical = PlayerPrefs.GetInt(m_LastPhysicalKey);
         }
         if (PlayerPrefs.HasKey(m_QuitTimeKey))
         {
             DTime time = DTime.Parse(PlayerPrefs.GetString(m_QuitTimeKey));
             DTime now = DTime.Now;
             DSpan span = now - time;
             int ap = span.Minutes / 30;
             ConstantData.physical += ap;
         }
     }
 }
예제 #2
0
 void Awake()
 {
     if (m_Instance)
     {
         Destroy(gameObject);
     }
     else
     {
         m_Instance = this;
         DontDestroyOnLoad(gameObject);
         if (PlayerPrefs.HasKey(m_LastPhysicalKey))
         {
             ConstantData.physical = PlayerPrefs.GetInt(m_LastPhysicalKey);
         }
         if (PlayerPrefs.HasKey(m_QuitTimeKey))
         {
             DTime time = DTime.Parse(PlayerPrefs.GetString(m_QuitTimeKey));
             DTime now  = DTime.Now;
             DSpan span = now - time;
             int   ap   = span.Minutes / 30;
             ConstantData.physical += ap;
         }
     }
 }
예제 #3
0
 void OnApplicationQuit()
 {
     m_Instance = null;
     PlayerPrefs.SetString(m_QuitTimeKey, System.DateTime.Now.ToString());
     PlayerPrefs.SetInt(m_LastPhysicalKey, ConstantData.physical);
 }
예제 #4
0
 void OnApplicationQuit()
 {
     m_Instance = null;
     PlayerPrefs.SetString(m_QuitTimeKey, System.DateTime.Now.ToString());
     PlayerPrefs.SetInt(m_LastPhysicalKey, ConstantData.physical);
 }