# Buttons

<details>

<summary>FunctionButton</summary>

Displays a button in the inspector that execute a function without parameters when clicked.

**Supported property types**

Everything.

**Parameters**

* Text
* FunctionName
* ClassType

<mark style="color:purple;">Code Example</mark>

```csharp
using UltimateAttributesPack;

public class FunctionButtonExample : MonoBehaviour
    {
        // You can use it to execute a function of the script in editor or play mode
        [FunctionButton("Click to log a message in console", "LogMessage", typeof(FunctionButtonExample))]
        public float floatValue;

        [FunctionButton("Click to increment value", "IncrementValue", typeof(FunctionButtonExample))]
        public int intValue;

        // You can also use it to call a function on another script of the object
        [FunctionButton("Click to log a message from another script of the object", "LogMessageOfOtherScript", typeof(DoOnValueChangedExample))]
        public string stringValue;

        void LogMessage()
        {
            Debug.Log("This is a message in the console");
        }

        void IncrementValue()
        {
            intValue++;
        }
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FX4zTdJgYZZskxDUpbPyq%2FFunctionButton.gif?alt=media&#x26;token=332ae105-ad50-4b20-bb8e-640d4a9a3356" alt="" data-size="original">

</details>

<details>

<summary>OpenFolderButton</summary>

Displays a button in the inspector that open a specific project folder when clicked.

**Supported property types**

Everything.

**Parameters**

* Text
* FolderPath

<mark style="color:purple;">Code Example</mark>

```csharp
using UltimateAttributesPack;

public class OpenFolderButtonExample : MonoBehaviour
    {
        // You can use it to open a specific folder of the project
        [OpenFolderButton("Click to open the UltimateAttributesPack root folder", "Assets/UltimateAttributesPack")]
        public float floatValue;
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FilaQf6qiWE7wbO1dp5er%2FOpenFolderButton.gif?alt=media&#x26;token=94f02c32-d39a-46f7-a22f-6743a754147e" alt="" data-size="original">

</details>

<details>

<summary>OpenInternetPageButton</summary>

Displays a button in the inspector that open a specific internet page when clicked.

**Supported property types**

Everything.

**Parameters**

* Text
* Link

<mark style="color:purple;">Code Example</mark>

```csharp
using UltimateAttributesPack;

public class OpenInternetPageButtonExample : MonoBehaviour
    {
        // You can use it in different ways, like redirecting to an online documentation or a specific video
        [OpenInternetPageButton("Click to open a specific internet page", "https://assetstore.unity.com/")]
        public float floatValue;
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FCjKSp6kFYPwOTE6y5tL4%2FOpenInternetPageButton.gif?alt=media&#x26;token=fe1ec8c6-aace-4a2b-9adc-a839cada98b6" alt="" data-size="original">

</details>

<details>

<summary>RandomizeButton</summary>

Displays a button at the right of the variable in the inspector that randomize it between a minimum, a maximum and a digits count when clicked.

**Supported property types**

* Float
* Int

**Parameters**

* MinValue
* MaxValue
* Digits

<mark style="color:purple;">Code Example</mark>

<pre class="language-csharp"><code class="lang-csharp">using UltimateAttributesPack;
<strong>
</strong><strong>public class RandomizeButtonExample : MonoBehaviour
</strong>    {
        // RandomizeButton attribute displays a button at the right of the variable to randomize the value between a min and a max and with a digits count
        // Digits count have a maximum of 5
        [RandomizeButton(0, 100, 3)]
        public float floatValue;

        // It also works with int
        [RandomizeButton(-50, 50, 0)]
        public int intValue;
    }
</code></pre>

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FHrjUoTGhL6WIiqNl0VlX%2FRandomizeButton.gif?alt=media&#x26;token=993c1bed-15a3-477e-b8ce-dda71016dbeb" alt="" data-size="original">

</details>

<details>

<summary>AddSubtractButtons</summary>

Displays two buttons in the inspector that add and subtract defined values to the variable when clicked.

**Supported property types**

* Float
* Int

**Parameters**

* SubtractValue
* AddValue

<mark style="color:purple;">Code Example</mark>

<pre class="language-csharp"><code class="lang-csharp">using UltimateAttributesPack;
<strong>
</strong><strong>public class AddSubtractButtonsExample : MonoBehaviour
</strong>    {
        // AddSubtractButtons attribute displays buttons at the right of the variable to add of subtract it with specific values
        [AddSubtractButtons(1, 1)]
        public int intValue;

        // It also works with float values
        [AddSubtractButtons(2.5f, 2.5f)]
        public float floatValue;
    }
</code></pre>

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FTDIzpMTia6eCcDOroASk%2FAddSubtractButtons.gif?alt=media&#x26;token=77f35e5e-f67c-4091-b509-9d6ede82091e" alt="" data-size="original">

</details>

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ashobot.gitbook.io/ultimate-attributes-pack/buttons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
