Exemplo n.º 1
0
    void OnEnable()
    {
        if (Application.isPlaying)
        {
            Debug.Assert(Instance == null);
        }

        Instance = this;
    }
Exemplo n.º 2
0
    void OnDisable()
    {
        if (Application.isPlaying)
        {
            Debug.Assert(Instance == this);
        }

        if (Instance == this)
        {
            Instance = null;
        }
    }