Munchy2007

screenfader4

May 25th, 2016
4,829
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.33 KB | None | 0 0
  1. var imageRect = image.GetComponent<RectTransform>();
  2. imageRect.anchorMin = Vector2.zero;
  3. imageRect.anchorMax  = Vector2.one;
  4. imageRect.anchoredPosition = Vector2.zero;
  5. imageRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal,Screen.width);
  6. imageRect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical,Screen.height);
Advertisement
Add Comment
Please, Sign In to add comment