示例#1
0
        internal List <string> GetIgnored()
        {
            //We already have a list of Ignores
            if (CombinedIgnored.Ignored.Count >= 1)
            {
                return(CombinedIgnored.Ignored);
            }
            //We have no list, so read the defaults
            else if (EditorPrefs.HasKey(playerPrefKey))
            {
                //Populates this class from prefs
                CombinedIgnored = LoadFromPrefs();
            }
            else
            {
                //Save the default values into prefs
                SaveDefault();
                //Try to get values again after having set default to prefs
                return(GetIgnored());
            }

            //Make sure default and combined are synced
            //If combined has element that doesn't exist in combined, add it!
            if (DefaultIgnored.Exists(val => !CombinedIgnored.Ignored.Contains(val)))
            {
                CombinedIgnored.Ignored.AddRange(DefaultIgnored.FindAll(val => !CombinedIgnored.Ignored.Contains(val)));
            }

            //Returns the values that have been read from prefs
            return(CombinedIgnored.Ignored);
        }
示例#2
0
 public void SaveDefault()
 {
     //Copy the default values into the other list
     CombinedIgnored = new SerializedIgnoreArray(DefaultIgnored);
     Save();
 }