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