---
tags:
    - "UI, Layout"
---

# Vertical Layout Group Spacing

[UI](../../index.md) / [Layout](../index.md) / [Vertical Layout Group](index.md) / **Vertical Layout Group Spacing**

## Description

Compares the Spacing property of Vertical Layout Group component to another value

## Parameters

| Name | Description |
| :--- | :---------- |
| Vertical Layout Group |  |
| Compare |  |
| Value |  |

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.UI;

namespace VisualScript.Runtime
{
    [Title("Vertical Layout Group Spacing")]
    [Category("UI/Layout/Vertical Layout Group/Spacing")]
    [Description("Compares the Spacing property of Vertical Layout Group component to another value")]

    [Image(typeof(IconVerticalLayoutGroup), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]

    [Parameter("Vertical Layout Group")]
    [Parameter("Compare")]
    [Parameter("Value")]

    [Serializable]
    public class GenConditionNumber_VerticalLayoutGroup_CheckSpacing : Condition
    {
        [SerializeField] private GetGameObject m_VerticalLayoutGroup = new GetGameObject(
            new GenTypeGameObject_VerticalLayoutGroup()
        );

        [SerializeField] private CompareNumber m_Compare = new CompareNumber();

        [SerializeField] private GetNumber m_Value = new GetNumber();

        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Spacing");
            return $"{this.m_VerticalLayoutGroup} {member} {this.m_Compare} {this.m_Value}";
        }

        protected override bool Run(Args args)
        {
            VerticalLayoutGroup component = this.m_VerticalLayoutGroup.Get<VerticalLayoutGroup>(args);
            if (component == null) return false;

            return this.m_Compare.Compare(component.spacing, (float) this.m_Value.Get(args));
        }
    }
}
```

