Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: vidjogamer on January 23, 2014, 10:57:11 AM

Title: UIButtonColor material error
Post by: vidjogamer on January 23, 2014, 10:57:11 AM
Just wanted to know if I should ignore this or if I should change it to sharedMaterial like Unity suggests. The errors are pretty annoying.

Instantiating material due to calling renderer.material during edit mode. This will leak materials into the scene. You most likely want to use renderer.sharedMaterial instead.
UnityEngine.Renderer:get_material()
UIButtonColor:Init() (at Assets/NGUI/Scripts/Interaction/UIButtonColor.cs:123)
UIButtonColor:Start() (at Assets/NGUI/Scripts/Interaction/UIButtonColor.cs:73)
Title: Re: UIButtonColor material error
Post by: ArenMook on January 24, 2014, 08:42:44 AM
I'm guessing that happens at edit time? Change that line to:
  1. mColor = Application.isPlaying ? ren.material.color : ren.sharedMaterial.color;
Title: Re: UIButtonColor material error
Post by: vidjogamer on January 24, 2014, 06:37:54 PM
Ok. Cool thanks. Are you going to change it in the next update?
Title: Re: UIButtonColor material error
Post by: ArenMook on January 24, 2014, 10:23:56 PM
Yup. Already changed for Pro users.