private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(this.gameObject); } else { Destroy(gameObject); } sparkNetwork = gameObject.AddComponent <GameSparksRTUnity> (); SceneManager.sceneLoaded += OnSceneLoaded; SceneManager.sceneUnloaded += OnSceneUnloaded; MatchFoundMessage.Listener = OnMatchFound; MatchNotFoundMessage.Listener = OnMatchNotFound; MatchUpdatedMessage.Listener = OnMatchUpdated; GS.GameSparksAvailable += (isAvailable) => { this.isAvailable = isAvailable; }; Update_SparkViews(); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }