Example #1
0
		/// <summary>
		/// Initializes the game state before the game starts.
		/// </summary>
		void Awake(){
			if(instance == null){ 	//making sure we only initialize one instance.
				instance = this;
				GameObject.DontDestroyOnLoad(this.gameObject);
			} else {					//Destroying unused instances.
				GameObject.Destroy(this);
			}

			//FONT
			//using max to be certain we have the longest side of the screen, even if we are in portrait.
			if(Mathf.Max(Screen.width, Screen.height) > 640){
				fontSuffix = "_2X"; //a nice suffix to show the fonts are twice as big as the original
			}
		}
        /// <summary>
        /// Handles a store controller initialized event.
        /// </summary>
        public void onSoomlaStoreInitialized()
        {
            // some usage examples for add/remove currency
            // some examples
            if (StoreInfo.Currencies.Count > 0)
            {
                try {
                    StoreInventory.GiveItem(StoreInfo.Currencies[0].ItemId, 4000);
                    SoomlaUtils.LogDebug("SOOMLA ExampleEventHandler", "Currency balance:" + StoreInventory.GetItemBalance(StoreInfo.Currencies[0].ItemId));
                } catch (VirtualItemNotFoundException ex) {
                    SoomlaUtils.LogError("SOOMLA ExampleEventHandler", ex.Message);
                }
            }

            ExampleWindow.GetInstance().setupItemsTextures();
        }
        /// <summary>
        /// Initializes the game state before the game starts.
        /// </summary>
        void Awake()
        {
            if (instance == null)               //making sure we only initialize one instance.
            {
                instance = this;
                GameObject.DontDestroyOnLoad(this.gameObject);
            }
            else                                                        //Destroying unused instances.
            {
                GameObject.Destroy(this);
            }

            //FONT
            //using max to be certain we have the longest side of the screen, even if we are in portrait.
            if (Mathf.Max(Screen.width, Screen.height) > 640)
            {
                fontSuffix = "_2X";                 //a nice suffix to show the fonts are twice as big as the original
            }
        }
Example #4
0
 /// <summary>
 /// Starts this instance.
 /// Use this for initialization.
 /// </summary>
 void Start()
 {
     ExampleWindow.OpenWindow();
 }