private void Awake() { if (instance != null) { throw new UnityException("Creating the second instance of UTNotificationsSample..."); } instance = this; }
private void OnDestroy() { Manager manager = Manager.Instance; if (manager != null) { manager.OnSendRegistrationId -= SendRegistrationId; manager.OnNotificationClicked -= OnNotificationClicked; manager.OnNotificationsReceived -= OnNotificationsReceived; } if (instance == this) { instance = null; } }