> For the complete documentation index, see [llms.txt](https://ashobot.gitbook.io/ultimate-attributes-pack/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ashobot.gitbook.io/ultimate-attributes-pack/buttons.md).

# 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="/files/R5e9vTUMeaxh41iGVqrz" 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="/files/5VOFIKEX062Mg3TILLWo" 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="/files/2lUBCdKmsPXSE7tqGwma" 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="/files/7qgfxXh6uvZ2BGlVSWae" 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="/files/7yzKovvCmCqlrHD29tcS" alt="" data-size="original">

</details>

***
