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

# Grid Layout Group Spacing

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

## Description

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

## Parameters

| Name | Description |
| :--- | :---------- |
| Grid Layout Group |  |
| 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("Grid Layout Group Spacing")]
    [Category("UI/Layout/Grid Layout Group/Spacing")]
    [Description("Compares the Spacing property of Grid Layout Group component to another value")]
    
    [Image(typeof(IconGridLayoutGroup), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]
    
    [Parameter("Grid Layout Group")]
    [Parameter("Value")]
    
    [Serializable]
    public class GenConditionVector2_GridLayoutGroup_CheckSpacing : Condition
    {
        [SerializeField] private GetGameObject m_GridLayoutGroup = new GetGameObject(
            new GenTypeGameObject_GridLayoutGroup()
        );
        
        [SerializeField] private GetVector2 m_Value = new GetVector2();
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Spacing");
            return $"{this.m_GridLayoutGroup} {member} = {this.m_Value}";
        }
        
        protected override bool Run(Args args)
        {
            GridLayoutGroup component = this.m_GridLayoutGroup.Get<GridLayoutGroup>(args);
            if (component == null) return false;
            
            return component.spacing == (Vector2) this.m_Value.Get(args);
        }
    }
}


```

