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