Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Amimoller on November 29, 2013, 02:59:09 AM

Title: using .Equals on Color creates garbage in UIWidget and UILabel
Post by: Amimoller on November 29, 2013, 02:59:09 AM
Hi,
I noticed that Color.Equals() is being used to compare colors in UIWidget and UILabel. This produces garbage because the color (which is a value type) is passed as an argument has to be boxed to an object.
You should be able to use != or == instead which takes a color as an argument and therefore does not create garbage.

Cheers!
Title: Re: using .Equals on Color creates garbage in UIWidget and UILabel
Post by: ArenMook on November 29, 2013, 09:27:14 AM
In which version? I don't see it being used in the latest.
Title: Re: using .Equals on Color creates garbage in UIWidget and UILabel
Post by: hogwash on December 12, 2013, 01:45:52 AM
Yeah I'm seeing the same issue. Line 132 of UIWidget.cs build 3.0.5
Title: Re: using .Equals on Color creates garbage in UIWidget and UILabel
Post by: ArenMook on December 12, 2013, 01:50:04 AM
You need to update.