Image Preserve Aspect#
UI / Graphic / Image / Image Preserve Aspect
Description#
Compares the Preserve Aspect property of Image component to another value
Parameters#
| Name | Description |
|---|---|
| Image |
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
{
[Title("Image Preserve Aspect")]
[Category("UI/Graphic/Image/Preserve Aspect")]
[Description("Compares the Preserve Aspect property of Image component to another value")]
[Image(typeof(IconUIImage), ColorTheme.Type.TextLight)]
[Keywords("UI, User, Interface")]
[Parameter("Image")]
[Serializable]
public class GenConditionBool_Image_CheckPreserveAspect : Condition
{
[SerializeField] private GetGameObject m_Image = new GetGameObject(
new GenTypeGameObject_Image()
);
protected override string GetTitle(GameObject source)
{
string member = TextUtils.ThemeAsKeyword("Preserve Aspect");
return $"{this.m_Image} {member}";
}
protected override bool Run(Args args)
{
Image component = this.m_Image.Get<Image>(args);
if (component == null) return false;
return component.preserveAspect;
}
}
}