Image Max Height#
UI / Graphic / Image / Image Max Height
Can Read
Cannot Write
Description#
The Max Height property of the Image 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]
[Title("Image Max Height")]
[Category("UI/Graphic/Image/Max Height")]
[Description("The Max Height property of the Image component")]
[Image(typeof(IconUIImage), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Serializable]
public class GenTypeNumber_Image_MaxHeight : TypeNumber
{
[SerializeField] private GetGameObject m_Image = new GetGameObject(
new GenTypeGameObject_Image()
);
public override double GetPreview(GameObject source)
{
GameObject instance = this.m_Image.GetPreview(source);
if (instance == null) return default;
Image component = instance.GetComponent<Image>();
return component != null ? component.maxHeight : default;
}
public override double Get(Args args)
{
Image instance = this.m_Image.Get<Image>(args);
return instance != null
? instance.maxHeight
: default;
}
public override string ToString()
{
return $"{this.m_Image} Max Height";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}