Toggle Group Allow Switch Off#
UI / Interaction / Toggle Group / Toggle Group Allow Switch Off
Can Read
Can Write
Description#
The Allow Switch Off property of the Toggle Group 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("Toggle Group Allow Switch Off")]
[Category("UI/Interaction/Toggle Group/Allow Switch Off")]
[Description("The Allow Switch Off property of the Toggle Group component")]
[Image(typeof(IconToggleGroup), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface, Checkbox")]
[Serializable]
public class GenTypeBool_ToggleGroup_AllowSwitchOff : TypeBool
{
[SerializeField] private GetGameObject m_ToggleGroup = new GetGameObject(
new GenTypeGameObject_ToggleGroup()
);
public override bool GetPreview(GameObject source)
{
GameObject instance = this.m_ToggleGroup.GetPreview(source);
if (instance == null) return default;
ToggleGroup component = instance.GetComponent<ToggleGroup>();
return component != null ? component.allowSwitchOff : default;
}
public override bool Get(Args args)
{
ToggleGroup instance = this.m_ToggleGroup.Get<ToggleGroup>(args);
return instance != null
? instance.allowSwitchOff
: default;
}
public override void Set(bool value, Args args)
{
ToggleGroup component = this.m_ToggleGroup.Get<ToggleGroup>(args);
if (component != null) component.allowSwitchOff = (bool) value;
}
public override string ToString()
{
return $"{this.m_ToggleGroup} Allow Switch Off";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}