Transform Scale Z#
Transform / Transform Scale Z
Can Read
Cannot Write
Description#
The Scale Z component of Transform component
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Transform Scale Z")]
[Category("Transform/Scale Z")]
[Description("The Scale Z component of Transform component")]
[Image(typeof(IconScale), ColorTheme.Type.Lime, typeof(BadgeZ))]
[Keywords("World", "Global", "Location", "Size")]
[Serializable]
public class TypeNumberTransformScaleZ : 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.z : 0;
}
public override string ToString()
{
return $"{this.m_Transform} Scale.z";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}