> 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/variable-aspect.md).

# Variable aspect

<details>

<summary>SetIcon</summary>

Displays an icon at the left of the variable.

**Supported property types**

Everything.

**Parameters**

* IconPath
* IconSize

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

```csharp
using UltimateAttributesPack;

public class SetIconExample : MonoBehaviour
    {
        // SetIcon attribute displays an icon at the left of the variable
        [SetIcon("Assets/UltimateAttributesPack/Examples/Assets/Icons/PenIcon.png")]
        public string stringValue;

        // You can also change the icon size (small, medium or large)
        [SetIcon("Assets/UltimateAttributesPack/Examples/Assets/Icons/PenIcon.png", IconSize.Large)]
        public string secondStringValue;
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FeXAGIu7oyxFI97YT8YW1%2FSetIcon.PNG?alt=media&amp;token=39bdc0c5-abe5-4b77-ad72-219001b3389c" alt="" data-size="original">

</details>

<details>

<summary>ChangeColor</summary>

Change the color of the variable (text or/and background).

**Supported property types**

Everything.

**Parameters**

* TextColor
* BackgroundColor

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

```csharp
using UltimateAttributesPack;

public class ChangeColorExample : MonoBehaviour
    {
        // You can change the text color and the background color of the variable
        [ChangeColor("red", "orange")]
        public string stringValue;

        // It also works hexadecimal
        [ChangeColor("C2E7FF", "444746")]
        public float floatValue;
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FdtR5syxG1b2fTDB2gtjI%2FChangeColor.PNG?alt=media&amp;token=3f4b6355-bd65-44ae-88e5-2c0b43582395" alt="" data-size="original">

</details>

<details>

<summary>ChangeLabel</summary>

Change the label of the variable.

**Supported property types**

Everything.

**Parameters**

* NewLabel

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

```csharp
using UltimateAttributesPack;

public class ChangeLabelExample : MonoBehaviour
    {
        // ChangeLabel attribute change the label of the variable in the inspector.
        [ChangeLabel("New Label")]
        public string stringValue; // The variable name is "stringValue" but the label displayed in the inspector is "New Label"
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FJ1iD9j6X5JHyD55mI1FR%2FChangeLabel.PNG?alt=media&amp;token=71527ac2-9a7f-4a6b-b57f-c71f7bd1be31" alt="" data-size="original">

</details>

<details>

<summary>Indent</summary>

Indent the variable to a target level in the inspector.

**Supported property types**

Everything.

**Parameters**

* IndentLevel

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

<pre class="language-csharp"><code class="lang-csharp">using UltimateAttributesPack;
<strong>
</strong><strong>public class IndentExample : MonoBehaviour
</strong>    {
        public string stringValue;

        // Indent attribute can be used to indent the variable to a specific level in the inspector
        [Indent(2)]
        public float floatValue;

        [Indent(4)]
        public float intValue;
    }
</code></pre>

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2Fmy9Bqma30UN8Tomd2We2%2FIndent.PNG?alt=media&amp;token=b1dfcb78-4790-4837-bb7b-fe2c4870b590" alt="" data-size="original">

</details>

<details>

<summary>Prefix</summary>

Displays a prefix text at the left of the variable in the inspector.

**Supported property types**

Everything.

**Parameters**

* PrefixText

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

<pre class="language-csharp"><code class="lang-csharp">using UltimateAttributesPack;
<strong>
</strong><strong>public class PrefixExample : MonoBehaviour
</strong>    {
        // Prefix attribute displays a prefix text at the left of the variable
        [Prefix("Prefix")]
        public string stringValue;
    }
</code></pre>

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FDzMYFtYuLqGiegV8djQm%2FPrefix.PNG?alt=media&amp;token=0d77e49a-3cca-451e-94c8-11f4929f653b" alt="" data-size="original">

</details>

<details>

<summary>Suffix</summary>

Displays a suffix text at the right of the variable in the inspector.

**Supported property types**

Everything.

**Parameters**

* SuffixText

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

```csharp
using UltimateAttributesPack;

public class SuffixExample : MonoBehaviour
    {
        // Suffix attribute displays a suffix text at the right of the variable
        [Suffix("Suffix")]
        public string stringValue;
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2Faf2UJrSboeEbNplFTGVT%2FSuffix.PNG?alt=media&amp;token=3e55026f-7843-4b60-a983-481c77a6b4f9" alt="" data-size="original">

</details>

<details>

<summary>ReadOnly</summary>

Displays the variable in read only in the inspector.

**Supported property types**

Everything.

**Parameters**

None.

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

```csharp
using UltimateAttributesPack;

public class ReadOnlyExample : MonoBehaviour
    {
        // It shows the variable in readonly in the inspector
        [ReadOnly]
        public float floatValue;
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FlABnxbnas8OXsSVU0HqC%2FReadOnly.PNG?alt=media&amp;token=514ca8eb-c4fe-457c-a5ca-0ecd53a7e0ee" alt="" data-size="original">

</details>

<details>

<summary>MinMaxSlider</summary>

Displays a MinMaxSlider for Vector2 or Vector2Int in the inspector.

**Supported property types**

* Vector2
* Vector2Int

**Parameters**

* Min
* Max

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

```csharp
using UltimateAttributesPack;

public class MinMaxSliderExample : MonoBehaviour
    {
        // MinMaxSliders are principally used to randomize between a min and a max values

        // You can use it on vector2
        [MinMaxSlider(0, 100)]
        public Vector2 vector2;

        // You can also use it on vector2Int
        [MinMaxSlider(0, 100)]
        public Vector2Int vector2Int;
    }
```

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FZ6QtV8x9FyndmvhPPojd%2FMinMaxSlider.PNG?alt=media&amp;token=47745c5a-96a5-4b75-9aca-cdf0139ed240" alt="" data-size="original">

</details>

<details>

<summary>ProgressBar</summary>

Displays a progress bar in the inspector with min and max values, and based on variable value.

**Supported property types**

* Float
* Int

**Parameters**

* Text
* Min
* Max
* DisplayPercent

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

<pre class="language-csharp"><code class="lang-csharp">using UltimateAttributesPack;
<strong>
</strong><strong>public class ProgressBarExample : MonoBehaviour
</strong>    {
        // To change the progress bar value, you can use the FunctionButton attribute
        [FunctionButton("Reset progress bar value", "ResetProgressBar", typeof(ProgressBarExample))]

        // You can also use the DoOnValueChanged attribute
        [DoOnValueChanged("SetProgressBar", typeof(ProgressBarExample))]
        public float currentValue;

        // You can use it to display a bar on the inspector to visualize the value between a min and a max
        [ProgressBar("Float value", 0, 100)]
        public float floatProgressBar;

        // You can also display the current percent of the value on the title
        [ProgressBar("Int value", 0, 100, true)]
        public int intProgressBar;

        void SetProgressBar()
        {
            floatProgressBar = currentValue;
            intProgressBar = Mathf.RoundToInt(currentValue);
        }

        void ResetProgressBar()
        {
            currentValue = 0;
            floatProgressBar = 0;
            intProgressBar = 0;
        }
    }
</code></pre>

<img src="https://3496865040-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxJRT3Vo5QZSbuYGZVtRD%2Fuploads%2FNx7kbk13i0OVzKxvnxC7%2FProgressBar.gif?alt=media&amp;token=62f008bd-b7ef-47d8-94fc-c355cbe14271" alt="" data-size="original">

</details>

***
