Пример #1
0
    /// <summary>
    /// When the corresponding button is clicked, delete the given key associated to the current logged in gamer.
    /// </summary>
    public void Button_DeleteGamerKey()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string key = "TestString";

        // Check the key value
        if (deleteGamerKey_Key == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "GamerVFS", "deleteGamerKey_Key"));
        }
        else if (!string.IsNullOrEmpty(deleteGamerKey_Key.text))
        {
            key = deleteGamerKey_Key.text;
        }

        // Call the template method
        GamerVFSFeatures.Handling_DeleteGamerKey(key);
    }
Пример #2
0
    /// <summary>
    /// When the corresponding button is clicked, create / update the value of the given key associated to the current logged in gamer.
    /// </summary>
    public void Button_SetGamerKey()
    {
        // Default hardcoded values to use if no InputField elements references are assigned
        string key   = "TestString";
        string value = "Test value.";

        Bundle.DataType type = Bundle.DataType.String;

        // Check the key value
        if (setGamerKey_Key == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "GamerVFS", "setGamerKey_Key"));
        }
        else if (!string.IsNullOrEmpty(setGamerKey_Key.text))
        {
            key = setGamerKey_Key.text;
        }

        // Check the value value
        if (setGamerKey_Value == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "GamerVFS", "setGamerKey_Value"));
        }
        else if (!string.IsNullOrEmpty(setGamerKey_Value.text))
        {
            value = setGamerKey_Value.text;
        }

        // Check the type value
        if (setGamerKey_Type == null)
        {
            Debug.LogWarning(string.Format(noReferenceFormat, "GamerVFS", "setGamerKey_Type"));
        }
        // This foreach should give only one active toggle
        else
        {
            foreach (Toggle activeToggle in setGamerKey_Type.ActiveToggles())
            {
                switch (activeToggle.name)
                {
                case "Toggle-JsonType":
                    type = Bundle.DataType.Object;
                    break;

                case "Toggle-StringType":
                    type = Bundle.DataType.String;
                    break;

                case "Toggle-DoubleType":
                    type = Bundle.DataType.Double;
                    break;

                case "Toggle-IntType":
                    type = Bundle.DataType.Integer;
                    break;

                case "Toggle-BoolType":
                    type = Bundle.DataType.Boolean;
                    break;
                }
            }
        }

        // Call the template method
        GamerVFSFeatures.Handling_SetGamerKey(type, key, value);
    }
Пример #3
0
 /// <summary>
 /// When the corresponding button is clicked, get and display the value of all keys associated to the current logged in gamer.
 /// </summary>
 public void Button_DisplayAllGamerKeys()
 {
     // Call the template method
     GamerVFSFeatures.Handling_DisplayGamerKey(null);
 }