Unity-UI-Extensions.GitHub.io

SwitchToRectTransform

RectTransform extension method to move one RectTransform to another


Contents

1 Overview

2 Properties

3 Methods

4 Usage

5 Video Demo

6 See also

7 Credits and Donation

8 External links


Overview

A programmatic extension that enables you, through code to move a RectTransform from one point on a screen to another point on the screen using a target RectTransform. This aligns all the Anchors, Pivots and offsets of the Target RectTransform.


Usage

Using this utility through code is very simply, just call:

sourceRectTransform.switchToRectTransform(targetRectTransform);

And the Source (from) Rect Transform will be moved to mimic the Target (to) RectTransform position.


See also

N/A


Credits and Donation