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