---
tags:
    - "UI, User, Interface"
---

# Slider Set Direction

[UI](../../index.md) / [Interaction](../index.md) / [Slider](index.md) / **Slider Set Direction**

## Description

Executes the Set Direction method on the Slider component

## Parameters

| Name | Description |
| :--- | :---------- |
| Direction |  |
| Include Rect Layouts |  |

## 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("Slider Set Direction")]
    [Category("UI/Interaction/Slider/Set Direction")]
    [Description("Executes the Set Direction method on the Slider component")]
    
    [Image(typeof(IconUISlider), ColorTheme.Type.TextLight)]
    [Keywords("UI, User, Interface")]
    
    [Parameter("Direction")]
    [Parameter("Include Rect Layouts")]
    
    [Serializable]
    public class GenInstructionSlider_SetDirection_2 : Instruction
    {
        [SerializeField] private GetGameObject m_Slider = new GetGameObject(
            new GenTypeGameObject_Slider()
        );
        
        [SerializeField] private Slider.Direction m_Direction = default;
        
        [SerializeField] private GetBool m_IncludeRectLayouts = new GetBool();
        
        protected override string GetTitle(GameObject source)
        {
            string method = TextUtils.ThemeAsKeyword("Set Direction");
            return $"{this.m_Slider} {method} ({this.m_Direction}, {this.m_IncludeRectLayouts})";
        }
        
        protected override Awaitable Run(Args args)
        {
            Slider component = this.m_Slider.Get<Slider>(args);
            if (component == null) return Done;
            
            component.SetDirection(
                this.m_Direction,
                (bool) this.m_IncludeRectLayouts.Get(args)
            );
            
            return Done;
        }
    }
}


```

