Set Layout Element Layout Priority#
UI / Layout / Layout Element / Set Layout Element Layout Priority
Description#
Sets the Layout Priority property of Layout Element component
Parameters#
| Name | Description |
|---|---|
| Layout Element | |
| Value |
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("Set Layout Element Layout Priority")]
[Category("UI/Layout/Layout Element/Layout Priority")]
[Description("Sets the Layout Priority property of Layout Element component")]
[Image(typeof(IconLayoutElement), ColorTheme.Type.TextLight)]
[Keywords("UI, Layout")]
[Parameter("Layout Element")]
[Parameter("Value")]
[Serializable]
public class GenInstructionInteger_LayoutElement_SetLayoutPriority : Instruction
{
[SerializeField] private GetGameObject m_LayoutElement = new GetGameObject(
new GenTypeGameObject_LayoutElement()
);
[SerializeField] private GetInteger m_Value = new GetInteger();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Layout Priority");
return $"{this.m_LayoutElement} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
LayoutElement component = this.m_LayoutElement.Get<LayoutElement>(args);
if (component == null) return Done;
component.layoutPriority = (int) this.m_Value.Get(args);
return Done;
}
}
}