public void TakeTime() { decimal value = Garter.I.Event("bestTime", 0.32M); Debug.Log(value); StaticHelpersGarterSDK.SdkDebugger("Garter.I.Event (\"bestTime\", 0.32M)", value.ToString("0.000")); }
public void RequestRewardAd() { StaticHelpersGarterSDK.SdkDebugger("Garter.I.RewardedAd('rewarded',callback)", "-", "-"); Garter.I.RequestAd("rewarded", (state) => { StaticHelpersGarterSDK.SdkDebugger("Garter.I.RequestAd('rewarded', callback)", "callback: " + state, "-"); }); }
public void GetUserNetworkId() { if (Garter.I.GetMultiplayerNetwork() != null) { StaticHelpersGarterSDK.SdkDebugger("Garter.I.NetworkUniqueUserId()", Garter.I.NetworkUniqueUserId(), "Returns unique network user id"); } else { StaticHelpersGarterSDK.SdkDebugger("-", "-", "Multiplayed is not set in init config"); } }
public void GetPhotonId() { //= AppId if (Garter.I.GetMultiplayerNetwork() != null) { string appId = Garter.I.GetMultiplayerNetwork()[0]; StaticHelpersGarterSDK.SdkDebugger("Garter.I.GetMultiplayerNetwork()[0]", appId, "Returns photon ID"); } else { StaticHelpersGarterSDK.SdkDebugger("-", "-", "Multiplayed is not set in init config"); } }
public void Redirect(bool toNewTab) { Garter.I.OpenWebPage("https://www.google.com", "individual", toNewTab); if (toNewTab) { StaticHelpersGarterSDK.SdkDebugger("Garter.I.OpenWebPage (\"https://www.google.com\")", "-", "-"); } else { StaticHelpersGarterSDK.SdkDebugger("Garter.I.OpenWebPage (\"https://www.google.com\",\"individual\", false)", "-", "-"); } }
public void GetPhotonVer() { //=AppVersion if (Garter.I.GetMultiplayerNetwork() != null) { string AppVersion = Garter.I.GetMultiplayerNetwork()[1]; StaticHelpersGarterSDK.SdkDebugger("Garter.I.GetMultiplayerNetwork()[1]", AppVersion, "Returns photon id ver"); } else { StaticHelpersGarterSDK.SdkDebugger("-", "-", "Multiplayed is not set in init config"); } }
public void ClearUserData(bool directly) { if (directly) { Garter.I.ClearDataUserConfirm(); StaticHelpersGarterSDK.SdkDebugger("Garter.I.ClearDataUserConfirm ()", "-", "Clear saved data request"); } else { Garter.I.ClearDataUserReq(); StaticHelpersGarterSDK.SdkDebugger("Garter.I.ClearDataUserReq ()", "-", "Clear saved data request"); } }
public void GetAllSlots() { string[] value5 = Garter.I.GetSlots(); string slots = ""; int i = 0; foreach (string key in value5) { slots += value5 [i] + ", "; i++; } StaticHelpersGarterSDK.SdkDebugger("Garter.I.GetSlots ()", slots, "Content of all slots"); }
public void GameProgress(bool getProgress) { if (getProgress) { StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserProgress ();", Garter.I.UserProgress().ToString(), "-"); } else { // set // generate random float number System.Random random = new System.Random(); float randomProgressVal = (float)random.Next(0, 100); StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserProgress (" + randomProgressVal + ");", Garter.I.UserProgress(randomProgressVal).ToString(), "Depends on game progress counting option"); } }
public void UpdateCurrency() { System.Random r = new System.Random(); decimal balanceChange = (decimal)r.Next(-10, 10); decimal c = Garter.I.LocalCurrency(balanceChange); StaticHelpersGarterSDK.SdkDebugger("Garter.I.LocalCurrency(" + balanceChange + ")", c.ToString("0.000"), "-"); GameObject userFunds = GameObject.Find("UserFunds"); if (userFunds != null) { Text userFundsTxt = userFunds.GetComponent <Text>(); userFundsTxt.text = "User funds: " + c; } }
public void CloseBanner(string position) { if (position == "top") { StaticHelpersGarterSDK.SdkDebugger("Garter.I.RequestAd('banner1', Garter.BannerAction.Hide, Garter.BannerPosition.Top, Garter.BannerSize.Banner, callback)", "-", "-"); Garter.I.RequestAd("banner1", Garter.BannerAction.Hide, Garter.BannerPosition.Top, Garter.BannerSize.Banner, (state) => { StaticHelpersGarterSDK.SdkDebugger("Garter.I.RequestAd('banner1', Garter.BannerAction.Hide, Garter.BannerPosition.Top, Garter.BannerSize.Banner, callback)", "callback: " + state, "-"); }); } else // bottom { StaticHelpersGarterSDK.SdkDebugger("Garter.I.RequestAd('banner2', Garter.BannerAction.Hide, Garter.BannerPosition.Bottom, Garter.BannerSize.Banner, callback)", "-", "-"); Garter.I.RequestAd("banner2", Garter.BannerAction.Hide, Garter.BannerPosition.Bottom, Garter.BannerSize.Banner, (state) => { StaticHelpersGarterSDK.SdkDebugger("Garter.I.RequestAd('banner2', Garter.BannerAction.Hide, Garter.BannerPosition.Bottom, Garter.BannerSize.Banner, callback)", "callback: " + state, "-"); }); } }
public void SetSlot(string query) { string[] attributes = query.Split('_'); int toSlotIndex = Int32.Parse(attributes [1]); string itemStringId = null, text = "Slot " + toSlotIndex + " was cleared"; if (!String.IsNullOrEmpty(attributes [0])) { itemStringId = attributes [0]; text = "Item " + itemStringId + " was attached to slot " + toSlotIndex + "."; } string resultReturned = Garter.I.SetSlot(toSlotIndex, itemStringId); if (string.IsNullOrEmpty(resultReturned)) { text = "Slot " + toSlotIndex + " is not available. Create it first by add slot button"; } StaticHelpersGarterSDK.SdkDebugger("Garter.I.SetSlot (" + toSlotIndex + ", " + itemStringId + ");", resultReturned, text); }
public void RequestFullscreenAdCb() { StaticHelpersGarterSDK.SdkDebugger("Garter.I.RequestAd('fullscreen', callback)", "-", "-"); Garter.I.RequestAd("fullscreen", (state) => { StaticHelpersGarterSDK.SdkDebugger("Garter.I.RequestAd('fullscreen', callback)", "callback: " + state, "-"); if (state == "loaded") { // MUTE GAME try { AudioListener.volume = 0f; AudioListener.pause = true; } catch { Debug.LogWarning("Problem in Audio Listener setting"); } Time.timeScale = 0f; } else if (state == "completed") { try { AudioListener.volume = 1f; AudioListener.pause = false; } catch { Debug.LogWarning("Problem in Audio Listener setting"); } Time.timeScale = 1f; } else { // ... } }); }
/********************* item properties ***************************/ public void GetItemState(string itemId) { StaticHelpersGarterSDK.SdkDebugger("Garter.I.ItemAvailability(" + itemId + ");", Garter.I.ItemAvailability(itemId).ToString(), "Item availability"); }
/***************************** slots (other functions) ***************************/ public void AddSlot() { int value = Garter.I.AddSlot(); StaticHelpersGarterSDK.SdkDebugger("Garter.I.AddSlot ()", value.ToString(), "Extend slots about one"); }
public void ClearSlot(int slotIndex) { StaticHelpersGarterSDK.SdkDebugger("Garter.I.SetSlot (" + slotIndex + ");", Garter.I.SetSlot(slotIndex).ToString(), "Slot index " + slotIndex + " was cleared"); }
public void GetSlot(int index) { string value = Garter.I.GetSlot(index); StaticHelpersGarterSDK.SdkDebugger("Garter.I.GetSlot (" + index + ")", (value != null) ? value.ToString() : null); }
public void Country() { StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserCountry()", Garter.I.UserCountry(), "Country a user is connected from"); }
public void GetKills() { decimal value = Garter.I.Event("kills"); StaticHelpersGarterSDK.SdkDebugger("Garter.I.Event (\"kills\")", value.ToString(), "all data (for illustration): kills: " + value + " | deaths: " + Garter.I.Event("deaths")); }
public void GetAccessory(string referentItem) { string value = Garter.I.GetAccessory(referentItem); StaticHelpersGarterSDK.SdkDebugger("Garter.I.GetAccessory (" + referentItem + ")", value, "Following accessories are attached to " + referentItem + " item"); }
public void GetTime() { decimal value = Garter.I.Event("bestTime"); StaticHelpersGarterSDK.SdkDebugger("Garter.I.Event (\"bestTime\")", value.ToString("0.000")); }
public void Rank() { StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserRankName()", Garter.I.UserRankName(), "-"); }
public void Logged() { StaticHelpersGarterSDK.SdkDebugger("Garter.I.IsLoggedUser()", Garter.I.IsLoggedUser().ToString(), "-"); }
public void Picture() { StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserImage()", "Texture2D image", "Returns user's profile image in Texture2D format"); }
/***************************** server ***************************/ public void PostManually() { Garter.I.PostDataManually(); StaticHelpersGarterSDK.SdkDebugger("Garter.I.PostDataManually()", "-", "Data posted to server manually."); }
public void SetAccessory(string reqQuery) { string[] attributes = reqQuery.Split('_'); Garter.I.SetAccessory(attributes[0], attributes[1]); StaticHelpersGarterSDK.SdkDebugger("Garter.I.SetAccessory (" + attributes[0] + ", " + attributes[0] + ")", "-", "Accessories for item " + attributes[0] + " were set)"); }
public void Nick() { StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserNick()", Garter.I.UserNick(), "-"); }
public void GetItemSlot(string itemStringId) { StaticHelpersGarterSDK.SdkDebugger("Garter.I.GetSlotOfItem(" + itemStringId + ")", Garter.I.GetSlotOfItem(itemStringId).ToString(), "Index of item " + itemStringId + " in the slot"); }
public void AddKills(int increaseAbout) { decimal value = Garter.I.Event("kills", increaseAbout); StaticHelpersGarterSDK.SdkDebugger("Garter.I.Event (\"kills\", " + increaseAbout + ")", value.ToString(), "all data (for illustration): kills: " + value + " | deaths: " + Garter.I.Event("deaths")); }
public void GetItemPropertyValue(string itemId_PropertyName) { string[] attributes = itemId_PropertyName.Split('_'); StaticHelpersGarterSDK.SdkDebugger("Garter.I.ItemPropertyValue (" + attributes[0] + ", " + attributes[1] + ")", Garter.I.ItemPropertyValue(attributes[0], attributes[1]).ToString(), "Performance of item property"); }