Skip to content

Game.UI.Widgets.Float3InputField

Assembly: Assembly-CSharp
Namespace: Game.UI.Widgets

Type: public class

Base: FloatField

Summary:
Concrete input field for editing 3-component floating point values (Unity.Mathematics.float3). This class specializes the generic FloatField for float3, providing component-wise default minimum and maximum bounds and converting from a double4 UI representation to the field's float3 type. It is intended for use in the game's UI widget system where 3D vector input is required.


Fields

  • None
    This class does not declare any instance fields.

Properties

  • protected override float3 defaultMin => new float3(float.MinValue)
    Provides the default minimum value for each component of the float3 field. By default each component is set to float.MinValue.

  • protected override float3 defaultMax => new float3(float.MaxValue)
    Provides the default maximum value for each component of the float3 field. By default each component is set to float.MaxValue.

Constructors

  • public Float3InputField()
    No explicit constructor is declared in source; the class uses the compiler-generated parameterless constructor. Initialization of behavior is inherited from the base FloatField.

Methods

  • public override float3 ToFieldType(double4 value)
    Converts a double4 (commonly used by the UI to represent numeric input with up to 4 components) into the field's float3 type. The implementation takes the xyz components of the provided double4 and constructs a float3 from them:
  • Input: double4 value
  • Output: float3 constructed from value.xyz (the w component is ignored)

Usage Example

using Unity.Mathematics;
using Game.UI.Widgets;

// create an instance (typical creation is managed by the UI framework)
var input = new Float3InputField();

// convert a double4 to the field type (takes xyz only)
double4 raw = new double4(1.5, 2.0, -0.25, 0.0);
float3 vec = input.ToFieldType(raw); // vec == new float3(1.5f, 2.0f, -0.25f)

// defaultMin/defaultMax describe the allowed range per component
// defaultMin => new float3(float.MinValue)
// defaultMax => new float3(float.MaxValue)

Notes: - The class depends on Unity.Mathematics types (float3, double4). - The conversion ignores the w component of double4 and maps xyz to float3.