PostProcessShaderIncludePath.cs 807 B

1234567891011121314151617181920212223242526
  1. using System.Linq;
  2. using UnityEngine;
  3. using System.IO;
  4. namespace UnityEditor.Experimental.Rendering
  5. {
  6. static class PostProcessShaderIncludePath
  7. {
  8. #if UNITY_2018_1_OR_NEWER && !UNITY_2018_3_OR_NEWER
  9. [ShaderIncludePath]
  10. #endif
  11. public static string[] GetPaths()
  12. {
  13. var srpMarker = Directory.GetFiles(Application.dataPath, "POSTFXMARKER", SearchOption.AllDirectories).FirstOrDefault();
  14. var paths = new string[srpMarker == null ? 1 : 2];
  15. var index = 0;
  16. if (srpMarker != null)
  17. {
  18. paths[index] = Directory.GetParent(srpMarker).ToString();
  19. index++;
  20. }
  21. paths[index] = Path.GetFullPath("Packages/com.unity.postprocessing");
  22. return paths;
  23. }
  24. }
  25. }