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); } }
// 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(); }
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); } }
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); }
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."); }
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."); }
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); }
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); }
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); }
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); }
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(); }