浏览代码

Fix script to update all materials

/main
sebastienlagarde 7 年前
当前提交
04c59bb1
共有 1 个文件被更改,包括 10 次插入3 次删除
  1. 13
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineMenuItems.cs

13
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineMenuItems.cs


var sceneName = Path.GetFileNameWithoutExtension(scenePath);
var description = string.Format("{0} {1}/{2} - ", sceneName, i + 1, scenes.Length);
ResetAllLoadedMaterialKeywords(description, scale, scale * i);
if (ResetAllLoadedMaterialKeywords(description, scale, scale * i))
{
EditorSceneManager.SaveScene(EditorSceneManager.GetActiveScene());
}
}
ResetAllMaterialAssetsKeywords(scale, scale * (scenes.Length - 1));

}
}
static void ResetAllLoadedMaterialKeywords(string descriptionPrefix, float progressScale, float progressOffset)
static bool ResetAllLoadedMaterialKeywords(string descriptionPrefix, float progressScale, float progressOffset)
bool anyMaterialDirty = false; // Will be true if any material is dirty.
for (int i = 0, length = materials.Length; i < length; i++)
{

(i / (float)(length - 1)) * progressScale + progressOffset);
CheckOutFile(VSCEnabled, materials[i]);
HDEditorUtils.ResetMaterialKeywords(materials[i]);
anyMaterialDirty = anyMaterialDirty || HDEditorUtils.ResetMaterialKeywords(materials[i]);
return anyMaterialDirty;
}
class UnityContextualLogHandler : ILogHandler

正在加载...
取消
保存