/// <summary>
        /// Displays the welcome screen of the game.
        /// </summary>
        void welcomeScreen()
        {
            //drawing background, just using a white pixel here
            GUI.DrawTexture(new Rect(0, 0, Screen.width, Screen.height), tImgDirect);
            //changing the font and alignment the label, and making a backup so we can put it back.
            Font       backupFont      = GUI.skin.label.font;
            TextAnchor backupAlignment = GUI.skin.label.alignment;

            GUI.skin.label.font      = fgoodDog;
            GUI.skin.label.alignment = TextAnchor.MiddleCenter;
            //writing the text.
            GUI.Label(new Rect(Screen.width / 8, Screen.height / 8f, Screen.width * 6f / 8f, Screen.height * 0.3f), "Soomla Store\nExample");
            //select the small font
            GUI.skin.label.font = fgoodDogSmall;
            GUI.Label(new Rect(Screen.width / 8, Screen.height * 7f / 8f, Screen.width * 6f / 8f, Screen.height / 8f), "Press the SOOMLA-bot to open store");
            //set font back to original
            GUI.skin.label.font = backupFont;
            GUI.Label(new Rect(Screen.width * 0.25f, Screen.height / 2 - 50, Screen.width * 0.5f, 100), "[ Your game here ]");
            //drawing button and testing if it has been clicked
            if (GUI.Button(new Rect(Screen.width * 2 / 6, Screen.height * 5f / 8f, Screen.width * 2 / 6, Screen.width * 2 / 6), tLogoNew))
            {
                guiState = GUIState.GOODS;
#if UNITY_ANDROID && !UNITY_EDITOR
                SoomlaStore.StartIabServiceInBg();
#endif
            }
            //set alignment to backup
            GUI.skin.label.alignment = backupAlignment;
        }
Exemple #2
0
 public void StopService()
 {
     if (hasStarted)
     {
         SoomlaStore.StartIabServiceInBg();
         hasStarted = false;
     }
 }
Exemple #3
0
 public void StartService()
 {
     if (!hasStarted)
     {
         hasStarted = true;
         SoomlaStore.StartIabServiceInBg();
     }
 }
Exemple #4
0
 private void OnDisable()
 {
     // Stop Iab Service
     if (this.started && this.enabledIab)
     {
         SoomlaStore.StartIabServiceInBg();
         this.enabledIab = false;
     }
 }
Exemple #5
0
    // Use this for initialization
    void Start()
    {
        // Initialise the shop
        SoomlaStore.Initialize(new CrapTrapAssets());
        SoomlaStore.StartIabServiceInBg();
        StoreEvents.OnMarketPurchase         += onMarketPurchase;
        StoreEvents.OnItemPurchased          += onItemPurchased;
        StoreEvents.OnGoodEquipped           += onGoodEquipped;
        StoreEvents.OnGoodUnEquipped         += onGoodUnequipped;
        StoreEvents.OnCurrencyBalanceChanged += onCurrencyBalanceChanged;

        // Initialise currency balance
        InitializeCurrencies();
        // Initialise shop items
        InitializeItemDictionary();
        // Check for equipped items
        InitializeEquippedGear();

        // Initialize Bag
        InitializeBag();
    }
 // Soomla 초기화후에 IAB 서비스를 개시한다.
 public void OnSoomlaStoreInitialized()
 {
             #if UNITY_ANDROID && !UNITY_EDITOR
     SoomlaStore.StartIabServiceInBg();
             #endif
 }