// To be applied to an object that contains a UIPanel component and an Animation component which changes the panel's clipping region
public class UIPanelAnimFudge : MonoBehaviour {
UIPanel mPanel;
Animation mAnimation;
UIWidget[] mWidgets;
void Start ()
{
mPanel = GetComponent<UIPanel>();
mWidgets = mPanel.transform.GetComponentsInChildren<UIWidget>() as UIWidget[];
mAnimation = GetComponent<Animation>();
}
void Update ()
{
if(mAnimation.isPlaying)
{
foreach(UIWidget widget in mWidgets)
{
widget.MarkAsChangedLite();
widget.visibleFlag = 1;
}
}
}
}