Пример #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.gameObject);
     }
 }
Пример #2
0
        // Constructeur
        public MainPage()
        {
            InitializeComponent();
            StoreEvents.GetInstance().OnCurrencyBalanceChangedEvent += new CurrencyBalanceChangedEventHandler(UpdateCurrencyBalance);
            StoreEvents.GetInstance().OnGoodBalanceChangedEvent     += new GoodBalanceChangedEventHandler(UpdateGoodBalance);
            StoreEvents.GetInstance().OnGoodEquippedEvent           += new GoodEquippedEventHandler(UpdateGoodEquip);
            StoreEvents.GetInstance().OnGoodUnEquippedEvent         += new GoodUnEquippedEventHandler(UpdateGoodUnequip);

            SoomlaConfig.logDebug = true;
            Soomla.initialize("this_is_my_secret");
            SoomlaStore.GetInstance().initialize(new StoreAssets(), true);

            /// Update the currencies balance on the GUI
            UpdateCurrencyBalance(null, 0, 0);
            buildShop();
        }
Пример #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.gameObject);
     }
 }
Пример #4
0
		protected override void _submitScore(Soomla.Profile.Provider provider, Soomla.Profile.Leaderboard to, int score, string payload) {
			soomlaProfile_SubmitScore(provider.ToString(), to.toJSONObject().ToString(), score, payload);
		}
Пример #5
0
		protected override void _showLeaderboards(Soomla.Profile.Provider provider, string payload) {
			soomlaProfile_ShowLeaderboards(provider.ToString(), payload);
		}
 protected override void _getScores(Soomla.Profile.Provider provider, Soomla.Profile.Leaderboard from, bool fromStart, string payload)
 {
     Soomla.SoomlaUtils.LogDebug(TAG, "Game services isn't supported in Android yet.");
 }
Пример #7
0
		protected override void _getScores(Soomla.Profile.Provider provider, Soomla.Profile.Leaderboard from, bool fromStart, string payload) {
			soomlaProfile_GetScores(provider.ToString(), from.toJSONObject().ToString(), fromStart, payload);
		}
 protected override void _reportScore(Soomla.Profile.Provider provider, Soomla.Profile.Leaderboard where, int score, string payload)
 {
     Soomla.SoomlaUtils.LogDebug(TAG, "Game services isn't supported in Android yet.");
 }
 protected override void _getLeaderboards(Soomla.Profile.Provider provider, string payload)
 {
     Soomla.SoomlaUtils.LogDebug(TAG, "Game services isn't supported in Android yet.");
 }
Пример #10
0
		protected override void _showLeaderboards(Soomla.Profile.Provider provider, string payload) {
			AndroidJNI.PushLocalFrame(100);
			using (AndroidJavaClass unityActivityClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
				using(AndroidJavaObject unityActivity = unityActivityClass.GetStatic<AndroidJavaObject>("currentActivity")) {
					using(AndroidJavaClass jniSoomlaProfile = new AndroidJavaClass("com.soomla.profile.unity.UnitySoomlaProfile")) {
						ProfileJNIHandler.CallStaticVoid(jniSoomlaProfile, "showLeaderboards", provider.ToString(), unityActivity, payload);
					}
				}
			}
			AndroidJNI.PopLocalFrame(IntPtr.Zero);
		}
Пример #11
0
		protected override void _submitScore(Soomla.Profile.Provider provider, Soomla.Profile.Leaderboard to, int score, string payload) {
			AndroidJNI.PushLocalFrame(100);
			using(AndroidJavaClass jniSoomlaProfile = new AndroidJavaClass("com.soomla.profile.unity.UnitySoomlaProfile")) {
				ProfileJNIHandler.CallStaticVoid(jniSoomlaProfile, "submitScore", provider.ToString(), to.toJSONObject().ToString(), score, payload);
			}
			AndroidJNI.PopLocalFrame(IntPtr.Zero);
		}
Пример #12
0
		protected override void _getScores(Soomla.Profile.Provider provider, Soomla.Profile.Leaderboard from, bool fromStart, string payload) {
			AndroidJNI.PushLocalFrame(100);
			using(AndroidJavaClass jniSoomlaProfile = new AndroidJavaClass("com.soomla.profile.unity.UnitySoomlaProfile")) {
				ProfileJNIHandler.CallStaticVoid(jniSoomlaProfile, "getScores", provider.ToString(), from.toJSONObject().ToString(), fromStart, payload);
			}
			AndroidJNI.PopLocalFrame(IntPtr.Zero);
		}
Пример #13
0
 protected override void _reportScore(Soomla.Profile.Provider provider, Soomla.Profile.Leaderboard where, int score, string payload)
 {
     soomlaProfile_ReportScore(provider.ToString(), where.toJSONObject().ToString(), score, payload);
 }
Пример #14
0
    public void onMarketPurchase( Soomla.Store.PurchasableVirtualItem pvi, string payload, Dictionary<string, string> extra)
    {
        Debug.Log( "OnMarketPurchase: " + pvi.ItemId );
        SaveManager.coinAmmount += 3000;
        SaveManager.SaveData();

        //Notify mission manager, and update shop display

        UpdateShopDisplay();
    }