I would like to get in a Unity C# script the value of a node.
This can be done with this line in a C# script:
PropTime = Material.GetFloat(“_PropTime”);
But how can I set the value of a green variable (like “Prop Time”) from a chain of nodes?
I would like to get in a Unity C# script the value of a node.
This can be done with this line in a C# script:
PropTime = Material.GetFloat(“_PropTime”);
But how can I set the value of a green variable (like “Prop Time”) from a chain of nodes?
Hi,
You can’t get it from inside the shader. If you need it in C#, make your calcul in C# et set it in shader.
The problem is that I need it to show properly in the editor scene view too so that I can tweak my shader’s values.
I tried to create my own Time in C# with [ExecuteInEditMode] but it gets called only so often and with EditorApplication.update but then it goes much faster than in my game.
EDIT:
PropTime = Time.realtimeSinceStartup; worked in combination EditorApplication.update !