Vector3 Y#
Vectors / Vector3 Y
Can Read
Cannot Write
Description#
The Y component of a Vector3
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Vector3 Y")]
[Category("Vectors/Vector3 Y")]
[Description("The Y component of a Vector3")]
[Image(typeof(IconVector3), ColorTheme.Type.Lime, typeof(BadgeY))]
[Keywords("Value", "Component", "Y", "G", "Yaw", "Up")]
[Serializable]
public class TypeNumberVector3Y : TypeNumber
{
[SerializeField] private GetVector3 m_Vector3 = new GetVector3();
public override double GetPreview(GameObject source) => this.m_Vector3.GetPreview(source).y;
public override double Get(Args args)
{
return this.m_Vector3.Get(args).y;
}
public override string ToString()
{
return $"{this.m_Vector3}.y";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}