Selectable Interactable#
UI / Interaction / Selectable / Selectable Interactable
Can Read
Can Write
Description#
The Interactable property of the Selectable component
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
{
[Get]
[Set]
[Title("Selectable Interactable")]
[Category("UI/Interaction/Selectable/Interactable")]
[Description("The Interactable property of the Selectable component")]
[Image(typeof(IconSelectable), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Serializable]
public class GenTypeBool_Selectable_Interactable : TypeBool
{
[SerializeField] private GetGameObject m_Selectable = new GetGameObject(
new GenTypeGameObject_Selectable()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_Selectable.GetPreview(source);
if (instance == null) return default;
Selectable component = instance.GetComponent<Selectable>();
return component != null ? component.interactable : default;
}
public override bool Get(Args args)
{
Selectable instance = this.m_Selectable.Get<Selectable>(args);
return instance != null
? instance.interactable
: default;
}
public override void Set(bool value, Args args)
{
Selectable component = this.m_Selectable.Get<Selectable>(args);
if (component != null) component.interactable = (bool) value;
}
public override string ToString()
{
return $"{this.m_Selectable} Interactable";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}