Exemple #1
0
        /// <summary>Method for editor, do not use it</summary>
        public static bool ContainsNestedSavables(IEnumerable <SaveableBase> source, SaveableBase self, out bool containsItself)
        {
            if (source == null)
            {
                containsItself = false;
                return(false);
            }

            bool value = false;

            foreach (var savable in source)
            {
                if (savable == null)
                {
                    continue;
                }

                if (savable.Equals(self))
                {
                    containsItself = true;
                    return(true);
                }

                if (savable is SavePackage || savable is SaveRegistry)
                {
                    value = true;
                }
            }

            containsItself = false;
            return(value);
        }
Exemple #2
0
        public bool AddSavedItem(SaveableBase entery)
        {
            if (allSaves.ContainsKey(entery.SaveID))
            {
                Debug.LogError($"The saveID {entery.SaveID} of {entery} are already exists, it must be unique!");
                return(false);
            }

            allSaves.Add(entery.SaveID, entery);
            return(true);
        }