Canvas Material UI Scaler resetting

0 votes
asked Jul 25, 2017 in Issue by maskedmouse (170 points)
edited Jul 25, 2017 by maskedmouse

Not sure if this is intended behaviour but when disabling the canvas gameobject and re-activating it the Material UI Scaler resets back to Dont Change Scale

Unity 2017.1f3 using the newest Material UI 1.1.7

 

Found the issue in the MaterialUIScaler.cs lines 579~582

if (targetCanvasScaler != null && targetCanvasScaler.enabled && scalerMode != ScalerMode.DontChangeScale)
{
    m_ScalerMode = ScalerMode.DontChangeScale;
}

 

commented Jul 27, 2017 by admin (31,720 points)
Do you have a Unity CanvasScaler on the same Canvas? If so, this is intended behaviour.
commented Jul 27, 2017 by maskedmouse (170 points)
No just the material UI scaler
commented Jul 28, 2017 by admin (31,720 points)
If you flip the inspector into debug mode, what does the MaterialUIScaler's 'Target Canvas Scaler' property look like?

1 Answer

0 votes
answered Jul 27, 2017 by admin (31,720 points)
Hi,

I put that there to avoid any errors should the canvas/scaler be created and not properly set up, or if the target scaler was unexpectedly removed. It looks like I'll have to find a more elegant solution though.

Thanks for bringing this to my attention :)

~ Declan.
Welcome to MaterialUI support! Ask us anything :)
...