Ejemplo n.º 1
0
    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"));
    }
Ejemplo n.º 2
0
 public void RequestRewardAd()
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.RewardedAd('rewarded',callback)", "-", "-");
     Garter.I.RequestAd("rewarded", (state) =>
     {
         StaticHelpersGarterSDK.SdkDebugger("Garter.I.RequestAd('rewarded', callback)", "callback: " + state, "-");
     });
 }
Ejemplo n.º 3
0
 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");
     }
 }
Ejemplo n.º 4
0
 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");
     }
 }
Ejemplo n.º 5
0
 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)", "-", "-");
     }
 }
Ejemplo n.º 6
0
 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");
     }
 }
Ejemplo n.º 7
0
 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");
     }
 }
Ejemplo n.º 8
0
    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");
    }
Ejemplo n.º 9
0
 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");
     }
 }
Ejemplo n.º 10
0
    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;
        }
    }
Ejemplo n.º 11
0
 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, "-");
         });
     }
 }
Ejemplo n.º 12
0
    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);
    }
Ejemplo n.º 13
0
    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
            {
                // ...
            }
        });
    }
Ejemplo n.º 14
0
 /********************* item properties ***************************/
 public void GetItemState(string itemId)
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.ItemAvailability(" + itemId + ");", Garter.I.ItemAvailability(itemId).ToString(), "Item availability");
 }
Ejemplo n.º 15
0
    /***************************** slots (other functions) ***************************/

    public void AddSlot()
    {
        int value = Garter.I.AddSlot();

        StaticHelpersGarterSDK.SdkDebugger("Garter.I.AddSlot ()", value.ToString(), "Extend slots about one");
    }
Ejemplo n.º 16
0
 public void ClearSlot(int slotIndex)
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.SetSlot (" + slotIndex + ");", Garter.I.SetSlot(slotIndex).ToString(), "Slot index " + slotIndex + " was cleared");
 }
Ejemplo n.º 17
0
    public void GetSlot(int index)
    {
        string value = Garter.I.GetSlot(index);

        StaticHelpersGarterSDK.SdkDebugger("Garter.I.GetSlot (" + index + ")", (value != null) ? value.ToString() : null);
    }
Ejemplo n.º 18
0
 public void Country()
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserCountry()", Garter.I.UserCountry(), "Country a user is connected from");
 }
Ejemplo n.º 19
0
    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"));
    }
Ejemplo n.º 20
0
    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");
    }
Ejemplo n.º 21
0
    public void GetTime()
    {
        decimal value = Garter.I.Event("bestTime");

        StaticHelpersGarterSDK.SdkDebugger("Garter.I.Event (\"bestTime\")", value.ToString("0.000"));
    }
Ejemplo n.º 22
0
 public void Rank()
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserRankName()", Garter.I.UserRankName(), "-");
 }
Ejemplo n.º 23
0
 public void Logged()
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.IsLoggedUser()", Garter.I.IsLoggedUser().ToString(), "-");
 }
Ejemplo n.º 24
0
 public void Picture()
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserImage()", "Texture2D image", "Returns user's profile image in Texture2D format");
 }
Ejemplo n.º 25
0
 /***************************** server ***************************/
 public void PostManually()
 {
     Garter.I.PostDataManually();
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.PostDataManually()", "-", "Data posted to server manually.");
 }
Ejemplo n.º 26
0
 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)");
 }
Ejemplo n.º 27
0
 public void Nick()
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.UserNick()", Garter.I.UserNick(), "-");
 }
Ejemplo n.º 28
0
 public void GetItemSlot(string itemStringId)
 {
     StaticHelpersGarterSDK.SdkDebugger("Garter.I.GetSlotOfItem(" + itemStringId + ")", Garter.I.GetSlotOfItem(itemStringId).ToString(), "Index of item " + itemStringId + " in the slot");
 }
Ejemplo n.º 29
0
    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"));
    }
Ejemplo n.º 30
0
 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");
 }