Ejemplo n.º 1
0
    void Start()
    {
        StoreEvents.OnMarketPurchase              += onMarketPurchase;
        StoreEvents.OnMarketRefund                += onMarketRefund;
        StoreEvents.OnItemPurchased               += onItemPurchased;
        StoreEvents.OnGoodEquipped                += onGoodEquipped;
        StoreEvents.OnGoodUnEquipped              += onGoodUnequipped;
        StoreEvents.OnGoodUpgrade                 += onGoodUpgrade;
        StoreEvents.OnBillingSupported            += onBillingSupported;
        StoreEvents.OnBillingNotSupported         += onBillingNotSupported;
        StoreEvents.OnMarketPurchaseStarted       += onMarketPurchaseStarted;
        StoreEvents.OnItemPurchaseStarted         += onItemPurchaseStarted;
        StoreEvents.OnUnexpectedErrorInStore      += onUnexpectedErrorInStore;
        StoreEvents.OnCurrencyBalanceChanged      += onCurrencyBalanceChanged;
        StoreEvents.OnGoodBalanceChanged          += onGoodBalanceChanged;
        StoreEvents.OnMarketPurchaseCancelled     += onMarketPurchaseCancelled;
        StoreEvents.OnRestoreTransactionsStarted  += onRestoreTransactionsStarted;
        StoreEvents.OnRestoreTransactionsFinished += onRestoreTransactionsFinished;

                #if UNITY_ANDROID && !UNITY_EDITOR
        StoreEvents.OnIabServiceStarted += onIabServiceStarted;
        StoreEvents.OnIabServiceStopped += onIabServiceStopped;
                #endif
        SoomlaStore.Initialize(new GameAssets());
    }
Ejemplo n.º 2
0
//Soomla ------------------------------------------------------------------------------------------------------

    /// Inicializa os Eventos do Soomla e Inicializa o SoomlaStore
    private void StartStoreEvents()
    {
        StoreEvents.OnSoomlaStoreInitialized  += OnSoomlaStoreInitialized;
        StoreEvents.OnItemPurchased           += OnItemPurchased;
        StoreEvents.OnCurrencyBalanceChanged  += onCurrencyBalanceChanged;
        StoreEvents.OnMarketPurchase          += onMarketPurchase;
        StoreEvents.OnMarketPurchaseCancelled += onMarketPurchaseCancelled;

        //Callbacks para teste
        StoreEvents.OnMarketPurchaseStarted       += onMarketPurchaseStarted;
        StoreEvents.OnGoodBalanceChanged          += onGoodBalanceChanged;
        StoreEvents.OnMarketRefund                += onMarketRefund;
        StoreEvents.OnMarketItemsRefreshStarted   += onMarketItemsRefreshStarted;
        StoreEvents.OnMarketItemsRefreshFinished  += onMarketItemsRefreshFinished;
        StoreEvents.OnRestoreTransactionsStarted  += onRestoreTransactionsStarted;
        StoreEvents.OnRestoreTransactionsFinished += onRestoreTransactionsFinished;
        StoreEvents.OnItemPurchaseStarted         += onItemPurchaseStarted;
        StoreEvents.OnGoodEquipped                += onGoodEquipped;
        StoreEvents.OnGoodUnEquipped              += onGoodUnequipped;
        StoreEvents.OnGoodUpgrade         += onGoodUpgrade;
        StoreEvents.OnBillingSupported    += onBillingSupported;
        StoreEvents.OnBillingNotSupported += onBillingNotSupported;

        if (!SoomlaStore.Initialized)
        {
            SoomlaStore.Initialize(new PowliticosStoreAssets(controller.AllVirtualGoods(), controller.powliticos.Length));
        }
        else
        {
            OnSoomlaStoreInitialized();
        }
    }
Ejemplo n.º 3
0
    void Initialize()
    {
        DontDestroyOnLoad(gameObject);

        Application.targetFrameRate = targetFrameRate;

        RestartSessionMetrics();

        // soomla store stuff
        StoreEvents.OnItemPurchased += onItemPurchased;
        StoreEvents.OnRestoreTransactionsFinished += onRestoreTransactionsFinished;
        if (!SoomlaStore.Initialized)
        {
            SoomlaStore.Initialize(new SoomlaStoreAssets());
        }

        gameDataBlob = new GameDataBlob();
        gameDataBlob.Init(saveDataFormatVersion);

        // create generic game service class
#if UNITY_IOS
        gameService = new AppleGameCenterAPI();
        gameService.Initialize();
#endif
#if UNITY_ANDROID
        gameService = new GooglePlayAPI();
#endif
#if UNITY_EDITOR
        gameService = new GameServiceMock();
#endif
        gameService.Initialize();

        // callback is managed in gameService API
        pendingCloudSaveOperation = 1;
    }
Ejemplo n.º 4
0
 void Start()
 {
     SoomlaStore.Initialize(new NinjevadeAssets());
     StoreEvents.OnMarketPurchaseStarted   += onMarketPurchaseStarted;
     StoreEvents.OnMarketPurchaseCancelled += onMarketPurchaseCancelled;
     StoreEvents.OnMarketPurchase          += onMarketPurchase;
 }
        /// <summary>
        /// Starts this instance.
        /// Use this for initialization.
        /// </summary>
        void Start()
        {
            handler = new ExampleEventHandler();

            SoomlaStore.Initialize(new MuffinRushAssets());

            SoomlaProfile.Initialize();

            //levelup
            World mainWorld = WorldGenerator.GenerateCustomWorld();

            SoomlaLevelUp.Initialize(mainWorld);
//			WorldGenerator.Play (mainWorld);

            tImgDirect    = (Texture2D)Resources.Load("SoomlaStore/images/img_direct");
            fgoodDog      = (Font)Resources.Load("SoomlaStore/GoodDog" + fontSuffix);
            fgoodDogSmall = (Font)Resources.Load("SoomlaStore/GoodDog_small" + fontSuffix);
            tLogoNew      = (Texture2D)Resources.Load("SoomlaStore/images/soomla_logo_new");
            tWhitePixel   = (Texture2D)Resources.Load("SoomlaStore/images/white_pixel");
            fTitle        = (Font)Resources.Load("SoomlaStore/Title" + fontSuffix);
            tMuffins      = (Texture2D)Resources.Load("SoomlaStore/images/Muffins");
            fName         = (Font)Resources.Load("SoomlaStore/Name" + fontSuffix);
            fDesc         = (Font)Resources.Load("SoomlaStore/Description" + fontSuffix);
            fBuy          = (Font)Resources.Load("SoomlaStore/Buy" + fontSuffix);
            tBack         = (Texture2D)Resources.Load("SoomlaStore/images/back");
            tGetMore      = (Texture2D)Resources.Load("SoomlaStore/images/GetMore");
            tTitle        = (Font)Resources.Load("SoomlaStore/Title" + fontSuffix);
        }
    void Start()
    {
        // Register callbacks for Grow Insights before initialization
        HighwayEvents.OnInsightsRefreshFinished += OnInsightsRefreshFinished;

        // Register callbacks for SOOMLA LevelUp before initialization
        LevelUpEvents.OnLevelEnded += OnLevelEnded;

        // Register callbacks for Chartboost events
        SetChartboostEvents();
        Chartboost.cacheInterstitial(CBLocation.LevelComplete);
        Chartboost.cacheRewardedVideo(CBLocation.LevelComplete);


        // Make sure to make this call in your earliest loading scene,
        // and before initializing any other SOOMLA/GROW components
        // i.e. before SoomlaStore.Initialize(...)
        GrowHighway.Initialize();
        GrowInsights.Initialize();

        // Initialize SOOMLA Store & LevelUp
        // Assumes you've implemented your store assets
        // and an initial world with levels and missions
        SoomlaStore.Initialize(new YourStoreAssetsImplementation());
        SoomlaLevelUp.Initialize(WORLD);
    }
Ejemplo n.º 7
0
        public void Initialize()
        {
            _handler = new CharsooStoreEventHandler();
            CharsooStoreAsset storeAsset = new CharsooStoreAsset();

            SoomlaStore.Initialize(storeAsset);
        }
Ejemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     SoomlaStore.Initialize(new MashinRunAssets());
     StoreEvents.OnMarketPurchaseCancelled += Failed;
     StoreEvents.OnMarketPurchase          += OnMarketPurchase;
     StoreEvents.OnItemPurchased           += Purchased;
     StoreEvents.OnMarketPurchaseCancelled += Canceled;
 }
Ejemplo n.º 9
0
        public void Awake()
        {
            Instance = this;
            if (Application.loadedLevelName == "map")
            {
                if (GameObject.Find("Canvas").transform.Find("MenuPlay").gameObject.activeSelf)
                {
                    GameObject.Find("Canvas").transform.Find("MenuPlay").gameObject.SetActive(false);
                }
            }
            RestLifeTimer = PlayerPrefs.GetFloat("RestLifeTimer");

//			if(InitScript.DateOfExit == "")
//			print(InitScript.DateOfExit );
            DateOfExit = PlayerPrefs.GetString("DateOfExit", "");

            Gems  = PlayerPrefs.GetInt("Gems");
            Lifes = PlayerPrefs.GetInt("Lifes");

            if (PlayerPrefs.GetInt("Lauched") == 0)
            {    //First lauching
                FirstTime = true;
                Lifes     = CapOfLife;
                Gems      = 5;
                PlayerPrefs.SetInt("Gems", Gems);
                PlayerPrefs.SetInt("Lifes", Lifes);
                PlayerPrefs.SetInt("Lauched", 1);
                PlayerPrefs.SetInt("Music", 1);
                PlayerPrefs.SetInt("Sound", 1);
                PlayerPrefs.Save();
            }

            GameObject.Find("Music").GetComponent <AudioSource>().volume = PlayerPrefs.GetInt("Music");
            SoundBase.Instance.GetComponent <AudioSource>().volume       = PlayerPrefs.GetInt("Sound");

            ReloadBoosts();

            boostPurchased = false;

            if (GameObject.Find("CoreEvents") == null)
            {
                GameObject core = Instantiate(Resources.Load("Soomla/CoreEvents")) as GameObject;
                core.name = "CoreEvents";
                Instantiate(Resources.Load("Soomla/StoreEvents"));
            }
            //StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreInitialized;
            //StoreEvents.OnCurrencyBalanceChanged += onCurrencyBalanceChanged;
            StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreInitialized;
            StoreEvents.OnMarketPurchase         += onMarketPurchase;
            try
            {
                SoomlaStore.Initialize(new SoomlaIntegration());
            }
            catch (Exception)
            {
                // throw;
            }
        }
    // Use this for initialization
    void Start()
    {
        // Initialize SOOMLA Store
        SoomlaStore.Initialize(new SoomlaAssets());

        // Request banner and interstitial form Admob
        requestNewBanner();
        requestNewInterstitial();
    }
Ejemplo n.º 11
0
 void Start()
 {
     SoomlaStore.Initialize(this);
     StoreEvents.OnCurrencyBalanceChanged += onCurrencyBalanceChanged;
     StoreEvents.OnItemPurchased          += onItemPurchased;
     StoreEvents.OnGoodBalanceChanged     += onGoodBalanceChanged;
     StoreEvents.OnMarketPurchase         += onMarketPurchase;
     StoreEvents.OnNotEnoughTargetItem    += onNotEnoughTargetItem;
 }
Ejemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        btn = GetComponent <Button>();

        // Initialize AdColony & SOOMLA Store
        InitializeAdColony();
        StoreEvents.OnCurrencyBalanceChanged += onCurrencyBalanceChanged;
        SoomlaStore.Initialize(new YourStoreAssetsImplementation());
    }
Ejemplo n.º 13
0
    private void Start()
    {
        // Register SOOMLA Store event handlers
        StoreEvents.OnMarketPurchase += MyBehaviour.OnMarketPurchase;

        // Initialize SOOMLA Store
        // Assumes you've implemented your store assets
        SoomlaStore.Initialize(new YourStoreAssetsImplementation());
    }
Ejemplo n.º 14
0
    public cIAP(string xml_filename)
    {
        ourIAPAssets = new IAP_Assets();

        parser = new cIAP_Parser();
        StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreInitialized;
        loadIAPData(xml_filename);
        //inicializar soomla
        SoomlaStore.Initialize(ourIAPAssets);
    }
Ejemplo n.º 15
0
	// Use this for initialization
	void Start () {
        StoreEvents.OnUnexpectedErrorInStore += onUnexpectedErrorInStore;


        SoomlaStore.Initialize(new IABItems());

        if (GameDataManager.ManangerInstance.IsFirstPlay)
            GiveItem();

    }
Ejemplo n.º 16
0
        public override void Load()
        {
            if (Assets == null)
            {
                Logs.Instance.ProcessError("Trying to initialize store without store assets");
                return;
            }

            SoomlaStore.Initialize(Assets);
        }
Ejemplo n.º 17
0
        void Start()
        {
//				Application.LoadLevel ("test");                                                                                                                         //Load actual scene/
//				DontDestroyOnLoad(transform.gameObject);                                                                                                        //Allows this gameObject to remain during level loads, solving restart crashes
            StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreIntitialized;

            SoomlaStore.Initialize(new StoreAssets());
            //StoreEvents.OnItemPurchased += onItemPurchased;
            StoreEvents.OnMarketPurchase += onMarketPurchase;
        }
Ejemplo n.º 18
0
 void Start()
 {
     SoomlaStore.Initialize(new BerryStoreAssets());
     StoreEvents.OnCurrencyBalanceChanged     += onCurrencyBalanceChanged;
     StoreEvents.OnItemPurchased              += onItemPurchased;
     StoreEvents.OnGoodBalanceChanged         += onGoodBalanceChanged;
     StoreEvents.OnMarketPurchase             += onMarketPurchase;
     StoreEvents.OnNotEnoughTargetItem        += onNotEnoughTargetItem;
     StoreEvents.OnMarketItemsRefreshFinished += onMarketItemsRefreshFinished;
 }
Ejemplo n.º 19
0
        void Start()
        {
            PlayerPrefs.GetInt("HasNoAdsBeenBought", 0);
            PlayerPrefs.Save();


            DontDestroyOnLoad(transform.gameObject);                                                                                            //Allows this gameObject to remain during level loads, solving restart crashes
            StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreIntitialized;                                                                  //Handle the initialization of store events (calls function below - unneeded in this case)
            SoomlaStore.Initialize(new PurchaseCharacters());                                                                                   //Intialize the store
        }
Ejemplo n.º 20
0
    // Use this for initialization
    void Start()
    {
        fetchConfig();
        GameData.Instance.versionCode         = int.Parse(versionCode.text.Trim());
        GameData.Instance.playerId            = 1;
        StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreInitialized;
        SoomlaStore.Initialize(new NumberGameAssets());

        Thread.Sleep(500);
        Application.LoadLevel("MainMenu");
    }
Ejemplo n.º 21
0
 void Start()
 {
     if (this.gameObject.name == "Initializer")
     {
         SoomlaStore.Initialize(new AppAssets());
         StoreEvents.OnItemPurchased += ShopScript.onItemPurchased;
     }
     else if (this.gameObject.name != "Initializer")
     {
         DontDestroyOnLoad(this.gameObject);
     }
 }
Ejemplo n.º 22
0
    // Use this for initialization
    void Start()
    {
        hasDisplayed    = false;
        roundScore.text = "Score " + Score.currentScore.ToString();
        highScore.text  = "High Score: " + PlayerPrefs.GetInt("highScore").ToString();
        //Chartboost.Create ();

        Chartboost.setAutoCacheAds(true);

        if (!SoomlaStore.Initialized)
        {
            SoomlaStore.Initialize(new Soomla.Store.GalaxyDefender.GalaxyDefenderAssets());
            SoomlaStore.RefreshInventory();
        }

        ItemBalance = StoreInventory.GetItemBalance("no_ads");

        if (ItemBalance > 0)
        {
            showAd = false;
        }
        else
        {
            showAd = true;
        }

        if (Score.currentScore >= 10000)
        {
            Social.ReportProgress("CgkIl_fbqZ4MEAIQAQ", 100.0f, (bool success) => { });
        }
        if (Score.currentScore >= 100000)
        {
            Social.ReportProgress("CgkIl_fbqZ4MEAIQAg", 100.0f, (bool success) => { });
        }
        if (Score.currentScore >= 250000)
        {
            Social.ReportProgress("CgkIl_fbqZ4MEAIQAw", 100.0f, (bool success) => { });
        }
        if (Score.currentScore >= 500000)
        {
            Social.ReportProgress("CgkIl_fbqZ4MEAIQBA", 100.0f, (bool success) => { });
        }
        if (Score.currentScore >= 1000000)
        {
            Social.ReportProgress("CgkIl_fbqZ4MEAIQBQ", 100.0f, (bool success) => { });
        }
        if (Score.currentScore >= 5000000)
        {
            Social.ReportProgress("CgkIl_fbqZ4MEAIQBw", 100.0f, (bool success) => { });
        }

        Social.ReportScore(Score.currentScore, "CgkIl_fbqZ4MEAIQBg", (bool success) => { });
    }
Ejemplo n.º 23
0
    IEnumerator Start()
    {
        // Bind Event
        StoreEvents.OnSoomlaStoreInitialized  += OnSoomlaStoreInitialized;
        StoreEvents.OnMarketPurchase          += OnMarketPurchase;
        StoreEvents.OnMarketPurchaseCancelled += OnMarketPurchaseCancelled;

        if (SoomlaStore.Initialized == false)
        {
            // Store Initialize
            yield return(SoomlaStore.Initialize(new PremiumVersionAsset()));
        }
    }
Ejemplo n.º 24
0
    //Load the Scene with the cube/ setup the soomla intergration
    void Start()
    {
        if (!mInstance)
        {
            mInstance = this;
        }

        Application.LoadLevel("MainMenu");                                                                                      //Load actual scene
        DontDestroyOnLoad(transform.gameObject);                                                                                //Allows this gameObject to remain during level loads, solving restart crashes
        StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreIntitialized;                                                      //Handle the initialization of store events (calls function below - unneeded in this case)
        StoreEvents.OnMarketPurchase         += onMarketPurchase;
        SoomlaStore.Initialize(new StoreAssets());                                                                              //Intialize the store
    }
Ejemplo n.º 25
0
    // Use this for initialization
    void Start()
    {
        audioIsOff = PlayerPrefs.GetInt("audioisoff");
        if (audioIsOff == 0)
        {
            // set audio ON
            soundButtonOFF.SetActive(false);
            soundButtonON.SetActive(true);
        }
        else
        {
            // set audio ON
            soundButtonOFF.SetActive(true);
            soundButtonON.SetActive(false);
        }

        PlayerPrefs.SetString("leaderboardid", LEADERBOARD_ID);
        PlayerPrefs.SetString("twittertext", TWITTER_MESSAGE);
        PlayerPrefs.SetString("admobbannerid", ADMOB_BANNER_ID);
        PlayerPrefs.SetString("INAPP_PURCHASE_REMOVE_ADS", INAPP_PURCHASE_REMOVE_ADS);
        Social.localUser.Authenticate(ProcessAuthentication);


        PlayBackgroundMusic();

        Chartboost.didFailToLoadMoreApps += didFailToLoadMoreApps;
        Chartboost.didDismissMoreApps    += didDismissMoreApps;
        Chartboost.didCloseMoreApps      += didCloseMoreApps;
        Chartboost.didClickMoreApps      += didClickMoreApps;
        Chartboost.didCacheMoreApps      += didCacheMoreApps;
        Chartboost.shouldDisplayMoreApps += shouldDisplayMoreApps;
        Chartboost.didDisplayMoreApps    += didDisplayMoreApps;
        Chartboost.cacheMoreApps(CBLocation.HomeScreen);

        AdsRemoved = PlayerPrefs.GetInt("adsremoved") == 1;
        if (AdsRemoved)
        {
            HideAdsButton();
        }
        else
        {
            RequestBanner();
        }

        StoreEvents.OnMarketItemsRefreshFailed    += storeRefreshFailed;
        StoreEvents.OnMarketPurchase              += onMarketPurchase;
        StoreEvents.OnItemPurchased               += onItemPurchased;
        StoreEvents.OnRestoreTransactionsFinished += onRestoreTransactionsFinished;
        SoomlaStore.Initialize(new GameAssets());
    }
Ejemplo n.º 26
0
    // Use this for initialization
    void Start()
    {
        //image_anim = image_ref.GetComponent<Animator>();
        //fadeColorAnimationClip = image_ref.GetComponent<Animation>();
        //fadeColorAnimationClip.Play ("FadeToColor");

        // Initialize the store assets
        SoomlaStore.Initialize(new SOAPStoreAssets());

        // Initialize soomla profile
        SoomlaProfile.Initialize();

        Invoke("LoadDelayed", 1.0f);
    }
Ejemplo n.º 27
0
 // Use this for initialization
 void Start()
 {
     if (alreadyInitialized)
     {
         GameObject.Destroy(this.gameObject);
     }
     else
     {
         Debug.Log("initialisation boutique");
         SoomlaStore.Initialize(new boutique());
         DontDestroyOnLoad(gameObject);
         alreadyInitialized = true;
     }
 }
Ejemplo n.º 28
0
    void Start()
    {
        StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreInitialized;
        StoreEvents.OnCurrencyBalanceChanged += onCurrencyBalanceChanged;
        StoreEvents.OnUnexpectedStoreError   += onUnexpectedStoreError;

        StoreEvents.OnMarketPurchase              += onMarketPurchase;
        StoreEvents.OnItemPurchased               += onItemPurchased;
        StoreEvents.OnMarketPurchaseStarted       += onMarketPurchaseStarted;
        StoreEvents.OnItemPurchaseStarted         += onItemPurchaseStarted;
        StoreEvents.OnMarketPurchaseCancelled     += onMarketPurchaseCancelled;
        StoreEvents.OnMarketPurchaseDeferred      += onMarketPurchaseDeferred;
        StoreEvents.OnRestoreTransactionsStarted  += onRestoreTransactionsStarted;
        StoreEvents.OnRestoreTransactionsFinished += onRestoreTransactionsFinished;

        SoomlaStore.Initialize(new SoomlaAssets());
    }
Ejemplo n.º 29
0
    private void Start()
    {
        // Just in case we started it in the level already.  It doesn't call OnLevelWasLoaded
        // when we first start the game in the editor.
        this.OnLevelWasLoaded(Application.loadedLevel);

        if (this.isFirstTime)
        {
            Debug.Log("GNOME: Subscribing to events");
            this.SubscribeToStoreEvents();
            Debug.Log("GNOME: Initializing store");
            SoomlaStore.Initialize(new GnomeStoreAssets());

            this.isFirstTime = false;
        }

        this.NotifyTokensChanged();
    }
Ejemplo n.º 30
0
        void Start()
        {
            StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreInitialized;

            StoreEvents.OnUnexpectedStoreError += onUnexpectedStoreError;


            GrowHighway.Initialize();
            bool modelSync = true;
            bool stateSync = true;

            GrowSync.Initialize(modelSync, stateSync);
            GrowGifting.Initialize();
            SoomlaProfile.Initialize();
            GrowInsights.Initialize();
            SoomlaStore.Initialize(new IAPAssets());
            StartCoroutine("loadMainScene");
            Invoke("loadGameNotAsync", 4);
        }