static void OnCacheChange() { var settings = Settings.Instance; settings.MasterBanks.Clear(); foreach (EditorBankRef bankRef in eventCache.MasterBanks) { settings.MasterBanks.Add(bankRef.Name); } settings.Banks.Clear(); foreach (var bankRef in eventCache.EditorBanks) { if (!eventCache.MasterBanks.Contains(bankRef) && !eventCache.StringsBanks.Contains(bankRef)) { settings.Banks.Add(bankRef.Name); } } settings.Banks.Sort((a, b) => string.Compare(a, b, StringComparison.CurrentCultureIgnoreCase)); EditorUtility.SetDirty(settings); EventBrowser.RepaintEventBrowser(); }
static void OnCacheChange() { var settings = Settings.Instance; settings.MasterBanks.Clear(); foreach (EditorBankRef bankRef in eventCache.MasterBanks) { settings.MasterBanks.Add(bankRef.Name); } settings.Banks.Clear(); foreach (var bankRef in eventCache.EditorBanks) { if (!eventCache.MasterBanks.Contains(bankRef) && !eventCache.StringsBanks.Contains(bankRef)) { settings.Banks.Add(bankRef.Name); } } EditorUtility.SetDirty(settings); CopyToStreamingAssets(); EventBrowser.RepaintEventBrowser(); }
static void OnCacheChange() { if (eventCache.MasterBankRef) { Settings.Instance.MasterBank = eventCache.MasterBankRef.Name; } else { Settings.Instance.MasterBank = null; } Settings.Instance.Banks.Clear(); foreach (var bankRef in eventCache.EditorBanks) { if (bankRef != eventCache.MasterBankRef && bankRef != eventCache.StringsBankRef) { Settings.Instance.Banks.Add(bankRef.Name); } } EditorUtility.SetDirty(Settings.Instance); EditorUtility.SetDirty(eventCache); CopyToStreamingAssets(); EventBrowser.RepaintEventBrowser(); }
static void OnCacheChange() { List <string> masterBanks = new List <string>(); List <string> banks = new List <string>(); var settings = Settings.Instance; bool hasChanged = false; foreach (EditorBankRef bankRef in eventCache.MasterBanks) { masterBanks.Add(bankRef.Name); } if (!CompareLists(masterBanks, settings.MasterBanks)) { settings.MasterBanks.Clear(); settings.MasterBanks.AddRange(masterBanks); hasChanged = true; } foreach (var bankRef in eventCache.EditorBanks) { if (!eventCache.MasterBanks.Contains(bankRef) && !eventCache.StringsBanks.Contains(bankRef)) { banks.Add(bankRef.Name); } } banks.Sort((a, b) => string.Compare(a, b, StringComparison.CurrentCultureIgnoreCase)); if (!CompareLists(banks, settings.Banks)) { settings.Banks.Clear(); settings.Banks.AddRange(banks); hasChanged = true; } if (hasChanged) { EditorUtility.SetDirty(settings); EventBrowser.RepaintEventBrowser(); } }
static void OnCacheChange() { Settings.Instance.MasterBanks.Clear(); foreach (EditorBankRef bankRef in eventCache.MasterBanks) { Settings.Instance.MasterBanks.Add(bankRef.Name); } Settings.Instance.Banks.Clear(); foreach (var bankRef in eventCache.EditorBanks) { if (!eventCache.MasterBanks.Contains(bankRef) && !eventCache.StringsBanks.Contains(bankRef)) { Settings.Instance.Banks.Add(bankRef.Name); } } CopyToStreamingAssets(); EventBrowser.RepaintEventBrowser(); }