Ejemplo n.º 1
0
    void Start()
    {
        if (instance == null)
        {
            instance = this;
            DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        if (m_StoreController == null)
        {
            InitializePurchasing();
        }
    }
Ejemplo n.º 2
0
        void Start()
        {
            UserEventsTracker.TrackEvent("Purchase screen. Start");

            _iapModule = new UnityIAP();
            _iapModule.Init(OnInitializeFailed);

            EventsChannel.General.Subscribe(EventConstants.PurchaseSuccess, (o, o1) =>
            {
                UserEventsTracker.TrackEvent("Purchase screen. Success purchase");

                OnSuccessPurchase();
            });

            EventsChannel.General.Subscribe(EventConstants.PurchaseFailed, (o, o1) =>
            {
                UserEventsTracker.TrackEvent("Purchase screen. Purchase failed:" + o1.ToString());

                OnFailedPurchase((PurchaseFailureReason)o1);
            });
        }