コード例 #1
0
        private void Update()
        {
#if UNITY_EDITOR
            if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.C))
            {
                UserDataManager.Save();
                Debug.LogError("Save");
            }
#endif
        }
コード例 #2
0
        private void SetUserDataFromLocal()
        {
            var path = Path.Combine(Application.persistentDataPath, SystemInfo.deviceUniqueIdentifier + ".json");

            if (!File.Exists(path))
            {
                UserDataManager.Init(new UserData());
            }
            else
            {
                var json = File.ReadAllText(path);
                UserDataManager.Init(JsonUtility.FromJson <UserData>(json));
            }
        }
コード例 #3
0
        private void OnApplicationPause(bool isPaused)
        {
            Debug.Log($"<color=yellow>OnApplicationPause isPaused = {isPaused}</color>");
#if !UNITY_EDITOR
            if (isPaused)
            {
                UserDataManager.Save();
            }
            else
            {
                if (!UserDataManager.Inited)
                {
                    return;
                }
                UserDataManager.SelectedDate = DateTime.Now;
                Events.OnUpdateTab?.Invoke();
            }
#endif
        }