Search Results for

    Show / Hide Table of Contents

    Class SingletonBehaviour<T>

    Singleton<T> adapted to extend UnityEngine.MonoBehaviour.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    SingletonBehaviour
    SingletonBehaviour<T>
    AbstractPlayer<T>
    Database
    ObjectPooler
    LoadingScreen
    Namespace: GGL.Singleton
    Assembly: GGL.dll
    Syntax
    [HelpURL("https://ggl.yoannhaffner.com/articles/singleton.html")]
    public abstract class SingletonBehaviour<T> : SingletonBehaviour where T : SingletonBehaviour<T>
    Type Parameters
    Name Description
    T

    Monobehaviour class

    Remarks

    When you can, try to setup static class to avoid using methods of a dead class.

    Examples

    LoadingScreen ou Database

    Properties

    | Edit this page View Source

    Initialized

    Declaration
    public static bool Initialized { get; }
    Property Value
    Type Description
    bool

    Check if the Singleton has been initialized. Happens if it has not yet been accessed nor awaken in any scene.

    | Edit this page View Source

    Instance

    Declaration
    public static T Instance { get; }
    Property Value
    Type Description
    T

    Access the cached instance. If it does not exist, it will be created on a new root GameObject.

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX