Creates a new rectangle.
var rect = Rect (0, 0, 10, 10);
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour { public Rect rect = new Rect(0, 0, 10, 10); }
position | The position of the top-left corner. |
size | The width and height. |
Creates a rectangle given a size and position.
This form of the constructor is convenient when you are already working with Vector2 values.