Skip to content

Game.UI.Widgets.IVisibleWidget

Assembly:
Assembly-CSharp (game runtime assembly containing game UI types)

Namespace:
Game.UI.Widgets

Type:
interface

Base:
None (interfaces do not have a concrete base type)

Summary:
IVisibleWidget is a small UI interface used by the game's widget system to query whether a widget is currently visible. Implementers expose a read-only boolean property that indicates visibility state. This is commonly used by the UI framework and other systems that need to check widget visibility without depending on concrete widget types.


Fields

  • (none)
    This interface declares no fields.

Properties

  • public bool isVisible { get; }
    Indicates whether the widget is currently visible. Implementations should return true when the widget is shown/active and false when hidden/inactive. Typical implementations map this to the underlying GameObject/visual element active state (for example, GameObject.activeSelf) or to an internal visibility flag.

Constructors

  • (none)
    Interfaces cannot declare constructors. Concrete implementers provide construction and initialization.

Methods

  • (none)
    This interface exposes only the visibility property; it defines no methods.

Usage Example

// Example implementation for a simple widget that wraps a Unity GameObject
public class SimpleWidget : IVisibleWidget
{
    private readonly UnityEngine.GameObject root;

    public SimpleWidget(UnityEngine.GameObject rootObject)
    {
        root = rootObject;
    }

    public bool isVisible => root != null && root.activeSelf;

    public void Show()  => root.SetActive(true);
    public void Hide()  => root.SetActive(false);
}

Notes: - Prefer mapping isVisible to the actual rendering/activation state so callers get an accurate result. - If a widget's visibility depends on layout passes or parent visibility, ensure the implementation accounts for parent/ancestor state if required by your mod.