> 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="/files/VSUs1fjZw1jJLZOer6ms" 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="/files/9JyFDwF0i5JKfz4YDDlG" 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="/files/okguKahuYAeOgN7BYhQj" 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="/files/l1S6CWhvTNOYZrfQmB14" 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="/files/AZbWTuQOApFm5nciS0sN" 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="/files/UhJ0WgnyGPEL15oORMt2" 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="/files/f96oHMjPYkJqFpY6TM5n" 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="/files/U29CRIA3GUuQ59H7JM2G" 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="/files/CaLvfmVXRsTIic6qNfME" alt="" data-size="original">

</details>

***
