// 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 component in the project void ReloadBaseTypes() { m_ComponentsDefaultState.Clear(); // Grab all the component types we can find baseComponentTypes = CoreUtils.GetAllAssemblyTypes() .Where(t => t.IsSubclassOf(typeof(VolumeComponent)) && !t.IsAbstract); // Keep an instance of each type to be used in a virtual lowest priority global volume // so that we have a default state to fallback to when exiting volumes foreach (var type in baseComponentTypes) { var inst = (VolumeComponent)ScriptableObject.CreateInstance(type); m_ComponentsDefaultState.Add(inst); } }
void LookUpDebugPanelClasses() { // Prepare all debug menus var types = CoreUtils.GetAllAssemblyTypes() .Where(t => t.IsSubclassOf(typeof(DebugPanel))); m_DebugPanels.Clear(); foreach (var type in types) { if (!type.IsGenericTypeDefinition) { AddDebugPanel((DebugPanel)Activator.CreateInstance(type)); } } }