private void ReloadBaseTypes() { CleanBaseTypes(); IEnumerable <Type> enumerable = from t in RuntimeUtilities.GetAllAssemblyTypes() where t.IsSubclassOf(typeof(PostProcessEffectSettings)) && t.IsDefined(typeof(PostProcessAttribute), inherit: false) && !t.IsAbstract select t; foreach (Type item in enumerable) { settingsTypes.Add(item, item.GetAttribute <PostProcessAttribute>()); PostProcessEffectSettings postProcessEffectSettings = (PostProcessEffectSettings)ScriptableObject.CreateInstance(item); postProcessEffectSettings.SetAllOverridesTo(state: true, excludeEnabled: false); m_BaseSettings.Add(postProcessEffectSettings); } }
// This will be called only once at runtime and everytime script reload kicks-in in the // editor as we need to keep track of any compatible post-processing effects in the project private void ReloadBaseTypes() { CleanBaseTypes(); // Rebuild the base type map var types = RuntimeUtilities.GetAllAssemblyTypes() .Where( t => t.IsSubclassOf(typeof(PostProcessEffectSettings)) && t.IsDefined(typeof(PostProcessAttribute), false) && !t.IsAbstract ); foreach (var type in types) { settingsTypes.Add(type, type.GetAttribute <PostProcessAttribute>()); // Create an instance for each effect type, these will be used for the lowest // priority global volume as we need a default state when exiting volume ranges var inst = (PostProcessEffectSettings)ScriptableObject.CreateInstance(type); inst.SetAllOverridesTo(true, false); m_BaseSettings.Add(inst); } }