docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Singleton<T>

    Inheritance
    object
    Singleton<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.VisualScripting
    Assembly: Unity.VisualScripting.Core.dll
    Syntax
    public static class Singleton<T> where T : MonoBehaviour, ISingleton
    Type Parameters
    Name Description
    T
    Remarks

    Does not support objects hidden with hide flags.

    Properties

    instance

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

    instantiated

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

    Methods

    Awake(T)

    Declaration
    public static void Awake(T instance)
    Parameters
    Type Name Description
    T instance

    Instantiate()

    Declaration
    public static T Instantiate()
    Returns
    Type Description
    T

    OnDestroy(T)

    Declaration
    public static void OnDestroy(T instance)
    Parameters
    Type Name Description
    T instance
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)