示例#1
0
 public virtual void OnApplicationQuit()
 {
     ClearPlayerStats();
     SaveAndLoadManager.RemoveData("Has paused");
     SaveAndLoadManager.RemoveData("Is online");
     GetSingleton <SaveAndLoadManager>().Save();
 }
示例#2
0
 public virtual void ClearPlayerStats()
 {
     SaveAndLoadManager.RemoveData("1 score");
     SaveAndLoadManager.RemoveData("2 score");
     SaveAndLoadManager.RemoveData("1 wins in a row");
     SaveAndLoadManager.RemoveData("2 wins in a row");
     SaveAndLoadManager.RemoveData("1 move speed multiplier");
     SaveAndLoadManager.RemoveData("2 move speed multiplier");
 }
示例#3
0
        public override void Awake()
        {
#if UNITY_EDITOR
            if (!Application.isPlaying)
            {
                Transform[]     transforms    = FindObjectsOfType <Transform>();
                IIdentifiable[] identifiables = new IIdentifiable[0];
                foreach (Transform trs in transforms)
                {
                    identifiables = trs.GetComponents <IIdentifiable>();
                    foreach (IIdentifiable identifiable in identifiables)
                    {
                        if (!UniqueIds.Contains(identifiable.UniqueId))
                        {
                            UniqueIds = UniqueIds.Add(identifiable.UniqueId);
                        }
                    }
                }
                return;
            }
#endif
            if (!initialized)
            {
                windowSize = new Vector2Int(Screen.width, Screen.height);
                ClearPlayerStats();
                SaveAndLoadManager.RemoveData("Has paused");
                initialized = true;
            }
            if (cursorEntries.Length > 0)
            {
                activeCursorEntry = null;
                cursorEntriesDict.Clear();
                foreach (CursorEntry cursorEntry in cursorEntries)
                {
                    cursorEntriesDict.Add(cursorEntry.name, cursorEntry);
                    cursorEntry.rectTrs.gameObject.SetActive(false);
                }
                Cursor.visible = false;
                cursorEntriesDict["Default"].SetAsActive();
            }
            base.Awake();
        }
示例#4
0
            public virtual void Do()
            {
                string _key = key;

                if (addActivePlayerUsernameToKey)
                {
                    _key = ArchivesManager.ActivePlayerUsername + ArchivesManager.VALUE_SEPARATOR + _key;
                }
                if (delete)
                {
                    SaveAndLoadManager.RemoveData(_key);
                }
                else
                {
                    if (intValue != MathfExtensions.NULL_INT)
                    {
                        if (isBoolValue)
                        {
                            if (intValue == 0)
                            {
                                SaveAndLoadManager.SetValue(_key, false);
                            }
                            else
                            {
                                SaveAndLoadManager.SetValue(_key, true);
                            }
                        }
                        else
                        {
                            SaveAndLoadManager.SetValue(_key, intValue);
                        }
                    }
                    else if (floatValue != MathfExtensions.NULL_FLOAT)
                    {
                        SaveAndLoadManager.SetValue(_key, floatValue);
                    }
                    else if (!string.IsNullOrEmpty(stringValue))
                    {
                        SaveAndLoadManager.SetValue(_key, stringValue);
                    }
                }
            }