#pragma warning restore 414 /// <summary> /// Initializes the game state before the game starts. /// </summary> void Awake(){ if(instance == null){ // making sure we only initialize one instance. SoomlaUtils.LogDebug(TAG, "Initializing ProfileEvents (Awake)"); instance = this; GameObject.DontDestroyOnLoad(this.gameObject); Initialize(); // now we initialize the event pusher #if UNITY_ANDROID && !UNITY_EDITOR pep = new ProfileEventPusherAndroid(); #elif UNITY_IOS && !UNITY_EDITOR pep = new ProfileEventPusherIOS(); #endif } else { // Destroying unused instances. GameObject.Destroy(this.gameObject); } }
#pragma warning restore 414 /// <summary> /// Initializes the game state before the game starts. /// </summary> void Awake() { if (instance == null) // making sure we only initialize one instance. { SoomlaUtils.LogDebug(TAG, "Initializing ProfileEvents (Awake)"); instance = this; GameObject.DontDestroyOnLoad(this.gameObject); Initialize(); // now we initialize the event pusher #if UNITY_ANDROID && !UNITY_EDITOR pep = new ProfileEventPusherAndroid(); #elif UNITY_IOS && !UNITY_EDITOR pep = new ProfileEventPusherIOS(); #endif } else // Destroying unused instances. { GameObject.Destroy(this.gameObject); } }