protected override void InsertItem(int index, IChronon item) { if (isTicking) { throw new InvalidOperationException("Can't modify collection inside Tick() method."); } base.InsertItem(index, item); _enabledParticles.Add(item); return; }
public void Save() { try { EnsureProfileDirectory(); NewJSON jsonStructure = new NewJSON() { DisabledList = new List <string>(DisabledList), Operation = Operation }; if (Operation == SetOperation.Expert) { // Update the EnabledList based on currently installed mods. if (EnabledList == null) { EnabledList = new HashSet <string>(); } foreach (string name in ModSelectorService.Instance._allExpertMods) { if (DisabledList.Contains(name)) { EnabledList.Remove(name); } else { EnabledList.Add(name); } } jsonStructure.EnabledList = new List <string>(EnabledList); } string jsonOutput = JsonConvert.SerializeObject(jsonStructure, Formatting.Indented); File.WriteAllText(FullPath, jsonOutput); } catch (Exception ex) { Debug.LogException(ex); } }