Example #1
0
    /// <summary>
    /// Anchor this rectangle to the specified transform.
    /// Note that this function will not keep the rectangle's current dimensions, but will instead assume the target's dimensions.
    /// </summary>

    public void SetAnchor(Transform t)
    {
        leftAnchor.SetTarget(t);
        rightAnchor.SetTarget(t);
        topAnchor.SetTarget(t);
        bottomAnchor.SetTarget(t);

        ResetAnchors();
        UpdateAnchors();
    }