docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class OptionalRectConverter

    UXML attribute converter for optional Rect values.

    Inheritance
    object
    UxmlAttributeConverter<Optional<Rect>>
    OptionalConverter<Rect>
    OptionalRectConverter
    Inherited Members
    OptionalConverter<Rect>.FromString(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.AppUI.Editor
    Assembly: Unity.AppUI.Editor.dll
    Syntax
    public class OptionalRectConverter : OptionalConverter<Rect>

    Methods

    ToString(Optional<Rect>)

    Converts an optional Rect into its UXML attribute representation.

    Declaration
    public override string ToString(Optional<Rect> value)
    Parameters
    Type Name Description
    Optional<Rect> value

    The value to convert.

    Returns
    Type Description
    string

    The rectangle formatted as x,y,width,height, or an empty string if no value is set.

    Overrides
    OptionalConverter<Rect>.ToString(Optional<Rect>)

    TryParse(string, out Rect)

    Tries to parse the attribute value as a Rect.

    Declaration
    protected override bool TryParse(string value, out Rect v)
    Parameters
    Type Name Description
    string value

    The string to parse, in the form x,y,width,height.

    Rect v

    The parsed rectangle, or the default rectangle if parsing failed.

    Returns
    Type Description
    bool

    True if the value could be parsed, False otherwise.

    Overrides
    OptionalConverter<Rect>.TryParse(string, out Rect)
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)