浏览代码

Added error log message to lightweight materials upgraders. Added to error information material name.

/main
Felipe Lira 7 年前
当前提交
d3e2a290
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2
      ScriptableRenderPipeline/Core/Editor/MaterialUpgrader.cs
  2. 4
      ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightMaterialUpgrader.cs

2
ScriptableRenderPipeline/Core/Editor/MaterialUpgrader.cs


if (upgrader != null)
upgrader.Upgrade(material, flags);
else if ((flags & UpgradeFlags.LogMessageWhenNoUpgraderFound) == UpgradeFlags.LogMessageWhenNoUpgraderFound)
Debug.Log(string.Format("There's no upgrader to convert {0} shader to selected pipeline", material.shader.name));
Debug.Log(string.Format("{0} material was not upgraded. There's no upgrader to convert {1} shader to selected pipeline", material.name, material.shader.name));
}
public static void UpgradeSelection(List<MaterialUpgrader> upgraders, string progressBarName, UpgradeFlags flags = UpgradeFlags.None)

4
ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightMaterialUpgrader.cs


List<MaterialUpgrader> upgraders = new List<MaterialUpgrader>();
GetUpgraders(ref upgraders);
MaterialUpgrader.UpgradeProjectFolder(upgraders, "Upgrade to Lightweight Pipeline Materials");
MaterialUpgrader.UpgradeProjectFolder(upgraders, "Upgrade to Lightweight Pipeline Materials", MaterialUpgrader.UpgradeFlags.LogMessageWhenNoUpgraderFound);
}
[MenuItem("Edit/Render Pipeline/Upgrade/Lightweight/Upgrade Selected Materials", priority = CoreUtils.editMenuPriority2)]

GetUpgraders(ref upgraders);
MaterialUpgrader.UpgradeSelection(upgraders, "Upgrade to Lightweight Pipeline Materials");
MaterialUpgrader.UpgradeSelection(upgraders, "Upgrade to Lightweight Pipeline Materials", MaterialUpgrader.UpgradeFlags.LogMessageWhenNoUpgraderFound);
}
private static void GetUpgraders(ref List<MaterialUpgrader> upgraders)

正在加载...
取消
保存