浏览代码

Merge pull request #1471 from Unity-Technologies/improve-material-upgrade

HDRP: improve material upgrade+ create hdrp version at a letter step
/main
GitHub 7 年前
当前提交
9a4c6386
共有 2 个文件被更改,包括 25 次插入5 次删除
  1. 22
      com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs
  2. 8
      com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs

22
com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/HDRPVersion.cs


// Compare project version with current version - Trigger an upgrade if user ask for it
if (GetCurrentHDRPProjectVersion() < hdrpVersion)
{
if (EditorUtility.DisplayDialog("A newer version of Unity has been detected",
"Do you want to upgrade your materials to newer version?\n You can also upgrade manually materials in Edit -> Render Pipeline submenu", "Yes", "No"))
if (EditorUtility.DisplayDialog("A newer version of HDRP has been detected",
"Do you want to upgrade your materials to newer version?\n You can also upgrade manually materials in 'Edit -> Render Pipeline' submenu", "Yes", "No"))
}
}
// Update current project version with HDRP version
WriteCurrentHDRPProjectVersion();
public class FileModificationWarning : UnityEditor.AssetModificationProcessor
{
static string[] OnWillSaveAssets(string[] paths)
{
foreach (string path in paths)
{
// Detect when we save project and write our HDRP version at this time.
if (path == "ProjectSettings/ProjectSettings.asset")
{
// Update current project version with HDRP version
HDRPVersion.WriteCurrentHDRPProjectVersion();
}
}
return paths;
}
}
}

8
com.unity.render-pipelines.high-definition/HDRP/Editor/Upgraders/UpgradeMenuItem.cs


}
}
[MenuItem("Edit/Render Pipeline/Update all Materials to latest version", priority = CoreUtils.editMenuPriority3)]
[MenuItem("Edit/Render Pipeline/Single step upgrade script/Upgrade all Materials EmissionColor", priority = CoreUtils.editMenuPriority3)]
static public void UpdateMaterialToNewerVersionEmissiveColor()
{
UpdateMaterialToNewerVersion("(EmissiveColor)", UpdateMaterial_EmissiveColor, UpdateMaterialFile_EmissiveColor);
}
[MenuItem("Edit/Render Pipeline/Upgrade all Materials to latest version", priority = CoreUtils.editMenuPriority3)]
static public void UpdateMaterialToNewerVersion()
{
// Add here all the material upgrade function supported in this version

正在加载...
取消
保存