public void SetStaticFileGeneratorTypeForCollection(ScriptableObjectCollection targetCollection, GeneratedStaticFileType staticCodeGeneratorType)
        {
            CollectionToSettings settings = GetOrCreateSettingsForCollection(targetCollection);

            settings.generatedStaticFileGeneratorType = staticCodeGeneratorType;
            ObjectUtility.SetDirty(this);
        }
        public void SetCollectionAutomaticallyLoaded(ScriptableObjectCollection targetCollection, bool isAutomaticallyLoaded)
        {
            CollectionToSettings settings = GetOrCreateSettingsForCollection(targetCollection);

            settings.isAutomaticallyLoaded = isAutomaticallyLoaded;
            ObjectUtility.SetDirty(this);
        }
        private CollectionToSettings GetOrCreateSettingsForCollection(ScriptableObjectCollection targetCollection)
        {
            if (!TryGetSettingsForCollection(targetCollection, out CollectionToSettings settings))
            {
                settings = new CollectionToSettings {
                    collection = targetCollection
                };
                collectionsSettings.Add(settings);
            }

            return(settings);
        }
 private bool TryGetSettingsForCollection(ScriptableObjectCollection targetCollection,
                                          out CollectionToSettings settings)
 {
     settings = collectionsSettings.FirstOrDefault(toSettings => toSettings.collection == targetCollection);
     return(settings != null);
 }