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