Skip to content

Instantly share code, notes, and snippets.

@simonwittber
Created June 1, 2020 01:33
Show Gist options
  • Save simonwittber/ccec4e76580a6fd20cee7ee80deebd5f to your computer and use it in GitHub Desktop.
Save simonwittber/ccec4e76580a6fd20cee7ee80deebd5f to your computer and use it in GitHub Desktop.
Howto: Write package dependent code for Unity.
{
"versionDefines": [
{
"name": "com.unity.render-pipelines.high-definition",
"expression": "7.3.1",
"define": "USE_HDRP"
}
],
}
public partial class SomeBehaviour : MonoBehaviour
{
//this method can be defined in other file, or just ignored.
partial public void SomeMethod();
void Update() {
SomeMethod();
}
}
#if USE_HDRP
public partial class SomeBehaviour : MonoBehaviour
{
partial public void SomeMethod() {
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment