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