- Home /
when change shader dynamically, the following function(shader.PropertyToID) ensures the same values?
I Wonder about this Function Shader.PropertyToID,
somebody help plz..m_m
This is sudo Code.
static GameMgr()
{
readonly static val nameID = Shader.PropertyID("_String");
}
================================
sometime...
GameMgr.LoadAssetBundle()
{
Resource.Load(Material);
CacheMaterial();
}
================================
GameObject Obj Generate...
Obj.Update()
{
material.setFloat(GameMgr.val, floatVal);
}
Comment
Your answer
Follow this Question
Related Questions
Material doesn't have a color property '_Color' 4 Answers
Changing Shader Graph texture through Script 1 Answer
Cannot change EmissionColor for HDRL/Lit shader from monoBehaviour 0 Answers
Can I make a lasting variable in Shader Graph?, 0 Answers
All C# Shader Scripts giving CS 8025 Parsing Error. 2 Answers