Rect Transform Set Local Left#
UI / Layout / Rect Transform / Rect Transform Set Local Left
Description#
Executes the Set Local Left method on the Rect Transform component
Parameters#
| Name | Description |
|---|---|
| Value | |
| Preserve Size |
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("Rect Transform Set Local Left")]
[Category("UI/Layout/Rect Transform/Set Local Left")]
[Description("Executes the Set Local Left method on the Rect Transform component")]
[Image(typeof(IconRectTransform), ColorTheme.Type.TextLight)]
[Keywords("UI, Layout")]
[Parameter("Value")]
[Parameter("Preserve Size")]
[Serializable]
public class GenInstructionRectTransform_SetLocalLeft_2 : Instruction
{
[SerializeField] private GetGameObject m_RectTransform = new GetGameObject(
new GenTypeGameObject_RectTransform()
);
[SerializeField] private GetNumber m_Value = new GetNumber();
[SerializeField] private GetBool m_PreserveSize = new GetBool();
protected override string GetTitle(GameObject source)
{
string method = TextUtils.ThemeAsKeyword("Set Local Left");
return $"{this.m_RectTransform} {method} ({this.m_Value}, {this.m_PreserveSize})";
}
protected override Awaitable Run(Args args)
{
RectTransform component = this.m_RectTransform.Get<RectTransform>(args);
if (component == null) return Done;
component.SetLocalLeft(
(float) this.m_Value.Get(args),
(bool) this.m_PreserveSize.Get(args)
);
return Done;
}
}
}