Пример #1
0
        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
            if(Mathf.Max(Screen.width, Screen.height) > 640){ //using max to be certain we have the longest side of the screen, even if we are in portrait.
                fontSuffix = "_2X"; //a nice suffix to show the fonts are twice as big as the original
            }
        }
Пример #2
0
        /// <summary>
        /// Handles a store controller initialized event.
        /// </summary>
        public void onStoreControllerInitialized()
        {
            ExampleLocalStoreInfo.Init();

            // some usage examples for add/remove currency
            // some examples
            if (ExampleLocalStoreInfo.VirtualCurrencies.Count > 0)
            {
                try {
                    StoreInventory.GiveItem(ExampleLocalStoreInfo.VirtualCurrencies[0].ItemId, 4000);
                    Utils.LogDebug("SOOMLA ExampleEventHandler", "Currency balance:" + StoreInventory.GetItemBalance(ExampleLocalStoreInfo.VirtualCurrencies[0].ItemId));
                } catch (VirtualItemNotFoundException ex) {
                    Utils.LogError("SOOMLA ExampleEventHandler", ex.Message);
                }
            }

            ExampleWindow.GetInstance().setupItemsTextures();
        }
Пример #3
0
        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
            if (Mathf.Max(Screen.width, Screen.height) > 640) //using max to be certain we have the longest side of the screen, even if we are in portrait.
            {
                fontSuffix = "_2X";                           //a nice suffix to show the fonts are twice as big as the original
            }
        }
Пример #4
0
 /// <summary>
 /// Starts this instance.
 /// Use this for initialization.
 /// </summary>
 void Start()
 {
     ExampleWindow.OpenWindow();
 }