Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: MaskedPixel on August 27, 2012, 02:10:49 PM

Title: UIStretch, Prefabs and Root Problems.
Post by: MaskedPixel on August 27, 2012, 02:10:49 PM
I have a prefab in which one of its children needs to have UIStretch on it.  When I NGUITools.AddChild it to the panel, the stretching doesn't work.  The reason is because mRoot in UIStretch is null.  It works fine after being disabled, and then enabled.  This is because mRoot is only assigned to in OnEnable.

Is there a more elegant solution than toggling enabled?

EDIT:  Other than changing NGUI code that is.
Title: Re: UIStretch, Prefabs and Root Problems.
Post by: ArenMook on August 27, 2012, 02:24:46 PM
Change OnEnable to be Start instead.