Set Dropdown Template#
UI / Interaction / Dropdown / Set Dropdown Template
Description#
Sets the Template property of Dropdown component
Parameters#
| Name | Description |
|---|---|
| Dropdown | |
| 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 Dropdown Template")]
[Category("UI/Interaction/Dropdown/Template")]
[Description("Sets the Template property of Dropdown component")]
[Image(typeof(IconUIDropdown), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Parameter("Dropdown")]
[Parameter("Value")]
[Serializable]
public class GenInstructionGameObject_Dropdown_SetTemplate : Instruction
{
[SerializeField] private GetGameObject m_Dropdown = new GetGameObject(
new GenTypeGameObject_Dropdown()
);
[SerializeField] private GetGameObject m_Value = new GetGameObject();
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Template");
return $"{this.m_Dropdown} {member} = {this.m_Value}";
}
protected override Awaitable Run(Args args)
{
Dropdown component = this.m_Dropdown.Get<Dropdown>(args);
if (component == null) return Done;
component.template = this.m_Value.Get<RectTransform>(args);
return Done;
}
}
}