Skip to content

Add HasInstance to Singletons to check if destroyed or created yet #65

@XDracam

Description

@XDracam
public static bool HasInstance => _instance != null;

A common use case is to deregister something from a singleton in OnDestroy, which can cause errors if the singleton has already been destroyed and a new one is created. So we need this property to let people check whether that is the case. Can also be used to safely handle Singleton instances without try/catch.

Might have implications on the Query system.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions