- Home /
SetMaterialBlock - anyone use this or know where documentation is?
One of the features in Unity 3.5 I read about in the "What's New" page was about SetMaterialBlock. It's implications seems very beneficial for not having to instance materials and change settings per instance.
Here's the description from the What's New page:
Added renderer.SetMaterialBlock for a lightweight way of adding per-instance material parameters without duplicating the materials. Also, the MaterialPropertyBlock does not have fixed small capacity any longer.
I can't find any documentation or any reference using Google to anyone who has used this. I saw someone mention it in one post on forum.unity3d.com, but beyond that, nothing.
Has anyone used this and could provide documentation on how to use it? I'm sure someone will mention use of it sooner or later, but I'd rather do things correctly the first time around.
Thanks so much.
Just wanted to note that there are no results returned when you search in the current documentation. http://unity3d.com/support/documentation/ScriptReference/30_search.html?q=Set$$anonymous$$aterialBlock
There is also no code hinting for the function in $$anonymous$$onodevelop-Unity 2.8.2
Answer by kaspar_unity · Apr 18, 2012 at 09:44 AM
Thanks for pointing it out. There's a mistake in the What's New page, the function is called SetPropertyBlock(). We will add documentation.
Answer by Bunny83 · Apr 18, 2012 at 10:00 AM
The function is called SetPropertyBlock.
You can find it when you look into the Renderer docs.
Your answer
Follow this Question
Related Questions
Changing two different objects renderer colour 1 Answer
Is it possible to change the colour of game objects without increasing the number of draw calls? 1 Answer
Change material inside instanced prefab, gameobject.renderer is NULL 1 Answer
Sharing materials in unity 1 Answer
Load, change material to game object II (not a repeat) 1 Answer