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

# Content Size Fitter Set Layout Horizontal

[UI](../../index.md) / [Layout](../index.md) / [Content Size Fitter](index.md) / **Content Size Fitter Set Layout Horizontal**

## Description

Executes the Set Layout Horizontal method on the Content Size Fitter component

## 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("Content Size Fitter Set Layout Horizontal")]
    [Category("UI/Layout/Content Size Fitter/Set Layout Horizontal")]
    [Description("Executes the Set Layout Horizontal method on the Content Size Fitter component")]
    
    [Image(typeof(IconContentSizeFitter), ColorTheme.Type.TextLight)]
    [Keywords("UI, Layout")]
    
    [Serializable]
    public class GenInstructionContentSizeFitter_SetLayoutHorizontal_0 : Instruction
    {
        [SerializeField] private GetGameObject m_ContentSizeFitter = new GetGameObject(
            new GenTypeGameObject_ContentSizeFitter()
        );
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Layout Horizontal");
            return $"{this.m_ContentSizeFitter} {method}";
        }
        
        protected override Awaitable Run(Args args)
        {
            ContentSizeFitter component = this.m_ContentSizeFitter.Get<ContentSizeFitter>(args);
            if (component == null) return Done;
            
            component.SetLayoutHorizontal();
            
            return Done;
        }
    }
}


```

