Skip to content

Game.UI.Widgets.InputFieldAttribute

Assembly:
{{ Likely compiled into the game's main assembly (e.g. Assembly-CSharp) or a UI-specific assembly. }}

Namespace: Game.UI.Widgets

Type: class (Attribute)

Base: UnityEngine.PropertyAttribute

Summary:
{{ Marker attribute used by the UI/widget system to indicate that a field or property should be rendered as an input field. This class contains no behavior itself — it simply tags a member so the UI framework (editor or runtime widget renderer) can create an appropriate input control. }}


Fields

  • None
    {{ This attribute defines no instance or static fields. It is an empty marker attribute. }}

Properties

  • None
    {{ There are no additional properties exposed by this attribute. It inherits no extra data from PropertyAttribute. }}

Constructors

  • public InputFieldAttribute()
    {{ Default parameterless constructor. No initialization logic — the attribute is used as a marker only. }}

Methods

  • None
    {{ The attribute contains no methods. Any behavior (rendering, validation, etc.) is implemented by the UI system that recognizes this attribute. }}

Usage Example

using Game.UI.Widgets;

// Mark a backing field or property to be rendered as an input field by the UI system:
[InputField]
public string playerName;

[InputField]
public int maxBuildings { get; set; }

{{ Notes: - The attribute is decorated with [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)], so it can be placed on fields or properties only. - Because InputFieldAttribute inherits from UnityEngine.PropertyAttribute, it follows Unity/engine conventions for property attributes, but requires the UI/widget code to read and handle it — by itself it does nothing. - Use this attribute when building custom inspector-like UIs or runtime widget generators that inspect members and choose widget types based on attributes. }}