Example #1
0
 /// <summary> Makes the RectTransform match its parent size </summary>
 /// <param name="target"> Target RectTransform </param>
 /// <param name="resetScaleToOne"> Reset LocalScale to Vector3.one </param>
 public static void FullScreen(this RectTransform target, bool resetScaleToOne)
 {
     if (resetScaleToOne)
     {
         target.ResetLocalScaleToOne();
     }
     target.AnchorMinToZero();
     target.AnchorMaxToOne();
     target.CenterPivot();
     target.SizeDeltaToZero();
     target.ResetAnchoredPosition3D();
     target.ResetLocalPosition();
 }