기술 자료

Unity Engine

Unity Engine

LocalToWorld

Transforms a point from the local space of the element to the world space.
읽는 시간 1분최근 업데이트: 한 달 전

Definition

LocalToWorld(VisualElement, Vector2)

Transforms a point from the local space of the element to the world space.
public static Vector2 LocalToWorld(this VisualElement ele, Vector2 p)

Parameters

The element to use as a reference for the local space.

The point to transform, in local space.

Returns

Type

Description

Vector2A point in the world space.

Remarks

This element needs to be attached to a panel and must receive a valid VisualElement.layout. Otherwise, this method may return invalid results.

LocalToWorld(VisualElement, Rect)

Transforms a rectangle from the local space of the element to the world space.
public static Rect LocalToWorld(this VisualElement ele, Rect r)

Parameters

The element to use as a reference for the local space.

The rectangle to transform, in local space.

Returns

Type

Description

RectA rectangle in the world space.

Remarks

This element needs to be attached to a panel and must receive a valid VisualElement.layout. Otherwise, this method may return invalid results.