Hello!
I'm changing materials of mesh renderers at a runtime when the character is frozen and when it gets back to normal.
Frozen material is an asset, it is always the same, and the main material is an instance (created in a runtime).
So I apply the material like this:
However,...
How to check if the material is an Instance or an Asset?
I'm changing materials of mesh renderers at a runtime when the character is frozen and when it gets back to normal.
Frozen material is an asset, it is always the same, and the main material is an instance (created in a runtime).
So I apply the material like this:
Code (CSharp):
- protected void SetMaterial(Material _material)
- {
- if (!_material) { return; }
- for (int i = 0; i < renderers.Length; i++)
- {
- renderers[i].material = _material;
- }
- }
How to check if the material is an Instance or an Asset?