Class Vector3Field
A UI component for editing 3D vector values with x, y, and z coordinates.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class Vector3Field : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder, IInputElement<Vector3>, IValidatableElement<Vector3>, ISizeableElement, INotifyValueChanging<Vector3>, INotifyValueChanged<Vector3>, IFormattable<float>
Remarks
The Vector3Field is a specialized input component that allows users to edit three-dimensional vector values. It provides three numerical input fields for the x, y, and z coordinates of a vector.
The component is built on top of three FloatField components, each handling one dimension of the vector. It supports various features like value validation, formatting, and size customization.
Use Vector3Field when you need to let users input or modify 3D coordinates, positions, scales, or any other three-dimensional values in your application.
Constructors
Vector3Field()
Default constructor.
Declaration
public Vector3Field()
Fields
containerUssClassName
The Vector3Field container styling class.
Declaration
public const string containerUssClassName = "appui-vector3field__container"
Field Value
| Type | Description |
|---|---|
| string |
sizeUssClassName
The Vector3Field size styling class.
Declaration
public const string sizeUssClassName = "appui-vector3field--size-"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The Vector3Field main styling class.
Declaration
public const string ussClassName = "appui-vector3field"
Field Value
| Type | Description |
|---|---|
| string |
xFieldUssClassName
The Vector3Field X NumericalField styling class.
Declaration
public const string xFieldUssClassName = "appui-vector3field__x-field"
Field Value
| Type | Description |
|---|---|
| string |
yFieldUssClassName
The Vector3Field Y NumericalField styling class.
Declaration
public const string yFieldUssClassName = "appui-vector3field__y-field"
Field Value
| Type | Description |
|---|---|
| string |
zFieldUssClassName
The Vector3Field Z NumericalField styling class.
Declaration
public const string zFieldUssClassName = "appui-vector3field__z-field"
Field Value
| Type | Description |
|---|---|
| string |
Properties
contentContainer
The content container of the Vector3Field.
Declaration
public override VisualElement contentContainer { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Overrides
formatFunction
The format function of the element.
Declaration
[CreateProperty]
public FormatFunction<float> formatFunction { get; set; }
Property Value
| Type | Description |
|---|---|
| FormatFunction<float> |
formatString
The format string of the element.
Declaration
[CreateProperty]
[UxmlAttribute]
public string formatString { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
invalid
The invalid state of the Vector3Field.
Declaration
[CreateProperty]
[UxmlAttribute]
public bool invalid { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
size
The size of the Vector3Field.
Declaration
[CreateProperty]
[UxmlAttribute]
public Size size { get; set; }
Property Value
| Type | Description |
|---|---|
| Size |
validateValue
The validation function of the Vector3Field.
Declaration
[CreateProperty]
public Func<Vector3, bool> validateValue { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<Vector3, bool> |
value
The value of the Vector3Field.
Declaration
[CreateProperty]
[UxmlAttribute]
public Vector3 value { get; set; }
Property Value
| Type | Description |
|---|---|
| Vector3 |
Methods
GetSizeUssClassName(Size)
Declaration
public static string GetSizeUssClassName(Size enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | enumValue |
Returns
| Type | Description |
|---|---|
| string |
SetValueWithoutNotify(Vector3)
Sets the value of the Vector3Field without notifying the change event.
Declaration
public void SetValueWithoutNotify(Vector3 newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | newValue | The new value to set. |