浏览代码

Merge pull request #1403 from Unity-Technologies/Remove-SRPMARKER

Remove SRPMARKER reference as it doesn't exist anymore
/main
GitHub 6 年前
当前提交
b0d2599c
共有 4 个文件被更改,包括 6 次插入53 次删除
  1. 12
      com.unity.render-pipelines.core/CoreRP/Editor/IncludePaths/CoreShaderIncludePaths.cs
  2. 23
      com.unity.render-pipelines.high-definition/HDRP/Editor/HDEditorUtils.cs
  3. 12
      com.unity.render-pipelines.high-definition/HDRP/Editor/HDShaderIncludePaths.cs
  4. 12
      com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightShaderIncludePaths.cs

12
com.unity.render-pipelines.core/CoreRP/Editor/IncludePaths/CoreShaderIncludePaths.cs


[ShaderIncludePath]
public static string[] GetPaths()
{
var srpMarker = Directory.GetFiles(Application.dataPath, "SRPMARKER", SearchOption.AllDirectories).FirstOrDefault();
var paths = new string[srpMarker == null ? 1 : 2];
var index = 0;
if (srpMarker != null)
{
var rootPath = Directory.GetParent(srpMarker).ToString();
paths[index] = Path.Combine(rootPath, "ScriptableRenderPipeline/Core");
index++;
}
paths[index] = Path.GetFullPath("Packages/com.unity.render-pipelines.core");
var paths = new string[1];
paths[0] = Path.GetFullPath("Packages/com.unity.render-pipelines.core");
return paths;
}
}

23
com.unity.render-pipelines.high-definition/HDRP/Editor/HDEditorUtils.cs


{ "HDRenderPipeline/Decal", DecalUI.SetupMaterialKeywordsAndPass }
};
// Note: This function returns null if used with a package setup.
static string GetScriptableRenderPipelinePath()
{
// User can create their own directory for SRP, so we need to find the current path that they use.
// We do that using the SRPMARKER file.
var srpMarkerPath = Directory.GetFiles(Application.dataPath, "SRPMARKER", SearchOption.AllDirectories).FirstOrDefault();
if (srpMarkerPath != null)
return new Uri(Application.dataPath).MakeRelativeUri(new Uri(Directory.GetParent(srpMarkerPath).ToString())).ToString();
return null;
}
var srpPath = GetScriptableRenderPipelinePath();
if (srpPath != null)
return Path.Combine(srpPath, "ScriptableRenderPipeline/HDRenderPipeline/HDRP/");
// If the SRPMARKER is not found, we assume that a package setup is used.
var srpPath = GetScriptableRenderPipelinePath();
if (srpPath != null)
return Path.Combine(srpPath, "PostProcessing/PostProcessing/");
// If the SRPMARKER is not found, we assume that a package setup is used.
var srpPath = GetScriptableRenderPipelinePath();
if (srpPath != null)
return Path.Combine(srpPath, "ScriptableRenderPipeline/Core/CoreRP/");
// If the SRPMARKER is not found, we assume that a package setup is used.
return "Packages/com.unity.render-pipelines.core/CoreRP/";
}

12
com.unity.render-pipelines.high-definition/HDRP/Editor/HDShaderIncludePaths.cs


[ShaderIncludePath]
public static string[] GetPaths()
{
var srpMarker = Directory.GetFiles(Application.dataPath, "SRPMARKER", SearchOption.AllDirectories).FirstOrDefault();
var paths = new string[srpMarker == null ? 1 : 2];
var index = 0;
if (srpMarker != null)
{
var rootPath = Directory.GetParent(srpMarker).ToString();
paths[index] = Path.Combine(rootPath, "ScriptableRenderPipeline/HDRenderPipeline");
index++;
}
paths[index] = Path.GetFullPath("Packages/com.unity.render-pipelines.high-definition");
var paths = new string[1];
paths[0] = Path.GetFullPath("Packages/com.unity.render-pipelines.high-definition");
return paths;
}
}

12
com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightShaderIncludePaths.cs


[ShaderIncludePath]
public static string[] GetPaths()
{
var srpMarker = Directory.GetFiles(Application.dataPath, "SRPMARKER", SearchOption.AllDirectories).FirstOrDefault();
var paths = new string[srpMarker == null ? 1 : 2];
var index = 0;
if (srpMarker != null)
{
var rootPath = Directory.GetParent(srpMarker).ToString();
paths[index] = Path.Combine(rootPath, "ScriptableRenderPipeline/LightweightPipeline");
index++;
}
paths[index] = Path.GetFullPath("Packages/com.unity.render-pipelines.lightweight");
var paths = new string[1];
paths[0] = Path.GetFullPath("Packages/com.unity.render-pipelines.lightweight");
return paths;
}
}
正在加载...
取消
保存