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