Transform Scale Y#
Transform / Transform Scale Y
Can Read
Cannot Write
Description#
The Scale Y component of Transform component
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Transform Scale Y")]
[Category("Transform/Scale Y")]
[Description("The Scale Y component of Transform component")]
[Image(typeof(IconScale), ColorTheme.Type.Lime, typeof(BadgeY))]
[Keywords("World", "Global", "Location", "Size")]
[Serializable]
public class TypeNumberTransformScaleY : TypeNumber
{
[SerializeField] private GetGameObject m_Transform = new GetGameObject(
new GenTypeGameObject_Transform()
);
public override double Get(Args args)
{
Transform transform = this.m_Transform.Get<Transform>(args);
return transform != null ? transform.lossyScale.y : 0;
}
public override string ToString()
{
return $"{this.m_Transform} Scale.y";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}