示例#1
0
    void OnEnable()
    {
        if (Application.isPlaying)
        {
            Debug.Assert(Instance == null);
        }

        Instance = this;
    }
示例#2
0
    void OnDisable()
    {
        if (Application.isPlaying)
        {
            Debug.Assert(Instance == this);
        }

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