Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 83ba405

Browse files
committed
Added support for [ShaderIncludePath] for the package manager in 2018.1
1 parent 0db0e8c commit 83ba405

File tree

6 files changed

+53
-1
lines changed

6 files changed

+53
-1
lines changed

.npmignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ Documentation/ApiDocs/**
88
issue_template.md
99
issue_template.md.meta
1010
QAReport.md
11-
QAReport.md.meta
11+
QAReport.md.meta
12+
/SRPMARKER*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Linq;
2+
using UnityEngine;
3+
using System.IO;
4+
5+
namespace UnityEditor.Experimental.Rendering
6+
{
7+
static class PostProcessShaderIncludePath
8+
{
9+
#if UNITY_2018_1_OR_NEWER
10+
[ShaderIncludePath]
11+
#endif
12+
public static string[] GetPaths()
13+
{
14+
var srpMarker = Directory.GetFiles(Application.dataPath, "SRPMARKER", SearchOption.AllDirectories).FirstOrDefault();
15+
var paths = new string[srpMarker == null ? 1 : 2];
16+
var index = 0;
17+
if (srpMarker != null)
18+
{
19+
paths[index] = Directory.GetParent(srpMarker).ToString();
20+
index++;
21+
}
22+
paths[index] = Path.GetFullPath("Packages/com.unity.postprocessing");
23+
return paths;
24+
}
25+
}
26+
}

PostProcessing/Editor/Utils/PostProcessShaderIncludePath.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SRPMARKER

Whitespace-only changes.

SRPMARKER.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

issue_template.md.meta

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)