Created
January 22, 2021 03:44
-
-
Save fum1h1ro/fd1b09c92192a893c24e0371f7f0aafd to your computer and use it in GitHub Desktop.
shaderconfig generator for HLSL Tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
pwd | |
PACKAGE_LINK=.shaderIncludes/Packages | |
PACKAGE_CACHE=Unity/Library/PackageCache | |
if [ -d $PACKAGE_LINK ]; then | |
rm -rf $PACKAGE_LINK | |
fi | |
mkdir -p $PACKAGE_LINK | |
for package in $PACKAGE_CACHE/*; do | |
without_version=${package%@*} | |
link_name=${without_version#$PACKAGE_CACHE/} | |
echo $link_name | |
ln -s ../../$package $PACKAGE_LINK/$link_name | |
done | |
project_version_txt=`head -n 1 Unity/ProjectSettings/ProjectVersion.txt` | |
UNITY_VERSION=${project_version_txt#* } | |
echo $UNITY_VERSION | |
cat - << EOS > shadertoolsconfig.json | |
{ | |
"hlsl.additionalIncludeDirectories": [ | |
".", | |
"/Applications/Unity/Hub/Editor/$UNITY_VERSION/Unity/Contents/CGIncludes", | |
".shaderIncludes" | |
] | |
} | |
EOS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment