浏览代码

only upgrade materials with the correct shader

/system-shock-transitional-shader
Paul Melamed 7 年前
当前提交
d5c19ff9
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 9
      ScriptableRenderPipeline/Core/Editor/MaterialUpgrader.cs

9
ScriptableRenderPipeline/Core/Editor/MaterialUpgrader.cs


public void Upgrade(Material material, UpgradeFlags flags)
{
if(material.shader.name != m_OldShader)
return;
Material newMaterial;
if ((flags & UpgradeFlags.CleanupNonUpgradedProperties) != 0)
{

}
Convert(material, newMaterial);
if (newMaterial.shaderKeywords.Length > 250)
{
Debug.LogError(string.Format("Too many keywords in material {0}", material.name));
}
material.shader = Shader.Find(m_NewShader);
material.CopyPropertiesFromMaterial(newMaterial);
UnityEngine.Object.DestroyImmediate(newMaterial);

正在加载...
取消
保存