gilescoope / shader-graph-nodes

Custom Nodes for Unity Shader Graph
MIT License
554 stars 50 forks source link

Added support for Unity 2019.4 - 2021.2 #5

Open neon-age opened 3 years ago

neon-age commented 3 years ago

Fork with updated version: https://github.com/neon-age/shader-graph-nodes

Issue

This asset still uses CodeFunctionNode API, which was made internal in 2018.2., Instead of it, Unity forces us to manually update ALL our nodes to sub-graphs, which is super clumsy and is not as robust. We can't do any custom UI or methods selection using it.

Solution

Instead of rewriting every node to sub-graphs, we'll just access forbidden API again, by using AsmRef: https://docs.unity.cn/2019.4/Documentation/Manual/class-AssemblyDefinitionReferenceImporter.html

Which only required:

The CodeFunctionNode API hasn't changed a bit since Unity 2018.2 and works in newer versions up to 2021.2!

daangijzen commented 6 months ago

This also works in 23.3.0b8