Skip to content

Game.UI.Widgets.TimeFieldAttribute

Assembly:
Assembly-CSharp (typical Unity runtime assembly for game scripts / mods)

Namespace:
Game.UI.Widgets

Type:
public class TimeFieldAttribute

Base:
UnityEngine.PropertyAttribute

Summary:
Marker attribute that indicates a field or property should be rendered using the game's "time field" UI (an inspector/editor control that accepts time values). This class contains no logic itself — it is intended to be detected by a custom property drawer or editor code that performs the actual rendering/handling. The attribute targets fields and properties.


Fields

  • This attribute defines no instance or static fields.
    Used purely as a metadata marker for editor/property-drawer code.

Properties

  • This attribute exposes no custom properties (only inherits members from UnityEngine.PropertyAttribute).

Constructors

  • public TimeFieldAttribute()
    Default parameterless constructor (implicit). Use this attribute by placing [TimeField] above a field or property declaration.

Methods

  • This class declares no methods. Any behavior is implemented by editor-side code (property drawers / custom inspectors) that recognizes the attribute.

Usage Example

using Game.UI.Widgets;
using UnityEngine;

public class ExampleComponent : MonoBehaviour
{
    // Apply to a field: the custom inspector/property drawer should render this as a time input.
    [TimeField]
    public int dayTimeSeconds;

    // Apply to a property (auto-property backing must be serialized or handled by custom editor)
    [TimeField]
    public int TimeOfDay { get; set; }
}

Notes: - The attribute is defined with [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)], so it can only be applied to properties or fields. - Because the attribute contains no code, ensure the mod or game editor includes the matching property-drawer/editor that knows how to render and interpret the marked member as a time field.