Recently we encountered a very weird bug in UIScrollView, which when assign different shaders to several UI2DSprite with same texture, those sprites will randomly change to the same shader.
It turns out that in UIPanel FindDrawCall method, it only check material and texture properties, but not check shader property.
This will result in the 2 widgets with null material, different shader, same texture considering to be the same.
Please check the following code:
UIPanel.cs at line 1730
bug one:
if (dcStart <= depth && dcEnd >= depth)
{
if (dc.baseMaterial == mat && dc.mainTexture == tex)
{
if (w.isVisible)
{
bug fixed:
Shader shader = w.shader;
if (dcStart <= depth && dcEnd >= depth)
{
if (dc.baseMaterial == mat && dc.shader == shader && dc.mainTexture == tex)
{
if (w.isVisible)
{