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