Exemplo n.º 1
0
 protected void OnDestroy()
 {
     if (instance == this)
     {
         instance = null;
         SpriteAtlasManager.atlasRequested -= RequestAtlas;
         Debug.Log("destory");
     }
 }
Exemplo n.º 2
0
    // Start is called before the first frame update
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }
        instance = this;
        SpriteAtlasManager.atlasRequested += RequestAtlas;

        DontDestroyOnLoad(gameObject);
    }