浏览代码

Fixed errors with mismatched dll versions [ugly hack]

/main
Thomas 7 年前
当前提交
699b4a98
共有 4 个文件被更改,包括 33 次插入24 次删除
  1. 18
      ScriptableRenderPipeline/Core/CoreUtils.cs
  2. 14
      ScriptableRenderPipeline/Core/Volume/Editor/VolumeComponentEditor.cs
  3. 16
      ScriptableRenderPipeline/Core/Volume/Editor/VolumeEditor.cs
  4. 9
      ScriptableRenderPipeline/Core/Volume/VolumeManager.cs

18
ScriptableRenderPipeline/Core/CoreUtils.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;

UnityObject.Destroy(obj);
#endif
}
}
public static IEnumerable<Type> GetAllAssemblyTypes()
{
return AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(t =>
{
// Ugly hack to handle mis-versioned dlls
var innerTypes = new Type[0];
try
{
innerTypes = t.GetTypes();
}
catch {}
return innerTypes;
});
}
public static void Destroy(params UnityObject[] objs)

14
ScriptableRenderPipeline/Core/Volume/Editor/VolumeComponentEditor.cs


s_ParameterDrawers.Clear();
// Look for all the valid parameter drawers
var types = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(
a => a.GetTypes()
.Where(
t => t.IsSubclassOf(typeof(VolumeParameterDrawer))
&& t.IsDefined(typeof(VolumeParameterDrawerAttribute), false)
)
);
var types = CoreUtils.GetAllAssemblyTypes()
.Where(
t => t.IsSubclassOf(typeof(VolumeParameterDrawer))
&& t.IsDefined(typeof(VolumeParameterDrawerAttribute), false)
&& !t.IsAbstract
);
// Store them
foreach (var type in types)

16
ScriptableRenderPipeline/Core/Volume/Editor/VolumeEditor.cs


using System;
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

m_Editors = new List<VolumeComponentEditor>();
// Gets the list of all available component editors
var editorTypes = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(
a => a.GetTypes()
.Where(
t => t.IsSubclassOf(typeof(VolumeComponentEditor))
&& t.IsDefined(typeof(VolumeComponentEditorAttribute), false)
)
).ToList();
var editorTypes = CoreUtils.GetAllAssemblyTypes()
.Where(
t => t.IsSubclassOf(typeof(VolumeComponentEditor))
&& t.IsDefined(typeof(VolumeComponentEditorAttribute), false)
&& !t.IsAbstract
);
// Map them to their corresponding component type
foreach (var editorType in editorTypes)

9
ScriptableRenderPipeline/Core/Volume/VolumeManager.cs


m_ComponentsDefaultState.Clear();
// Rebuild it from scratch
var types = AppDomain.CurrentDomain.GetAssemblies()
.SelectMany(
a => a.GetTypes()
.Where(
t => t.IsSubclassOf(typeof(VolumeComponent)) && !t.IsAbstract
)
);
var types = CoreUtils.GetAllAssemblyTypes()
.Where(t => t.IsSubclassOf(typeof(VolumeComponent)) && !t.IsAbstract);
foreach (var type in types)
{

正在加载...
取消
保存