Scrollbar Set Direction#
UI / Scroll / Scrollbar / Scrollbar Set Direction
Description#
Executes the Set Direction method on the Scrollbar component
Parameters#
| Name | Description |
|---|---|
| Direction | |
| Include Rect Layouts |
Code#
// <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("Scrollbar Set Direction")]
[Category("UI/Scroll/Scrollbar/Set Direction")]
[Description("Executes the Set Direction method on the Scrollbar component")]
[Image(typeof(IconScrollBar), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Parameter("Direction")]
[Parameter("Include Rect Layouts")]
[Serializable]
public class GenInstructionScrollbar_SetDirection_2 : Instruction
{
[SerializeField] private GetGameObject m_Scrollbar = new GetGameObject(
new GenTypeGameObject_Scrollbar()
);
[SerializeField] private Scrollbar.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_Scrollbar} {method} ({this.m_Direction}, {this.m_IncludeRectLayouts})";
}
protected override Awaitable Run(Args args)
{
Scrollbar component = this.m_Scrollbar.Get<Scrollbar>(args);
if (component == null) return Done;
component.SetDirection(
this.m_Direction,
(bool) this.m_IncludeRectLayouts.Get(args)
);
return Done;
}
}
}