Min#
Math / Min
Can Read
Cannot Write
Description#
Returns a vector that is made from the smallest components of two vectors
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Min")]
[Category("Math/Min")]
[Description("Returns a vector that is made from the smallest components of two vectors")]
[Image(typeof(IconLessThan), ColorTheme.Type.Yellow)]
[Keywords("Vector")]
[Serializable]
public class TypeVector2MathMin : TypeVector2
{
[SerializeField] private GetVector2 m_VectorA = new GetVector2();
[SerializeField] private GetVector2 m_VectorB = new GetVector2();
public override Vector2 GetPreview(GameObject source) =>
Vector2.Min(this.m_VectorA.GetPreview(source), this.m_VectorB.GetPreview(source));
public override Vector2 Get(Args args)
{
return Vector2.Min(
this.m_VectorA.Get(args),
this.m_VectorB.Get(args)
);
}
public override string ToString()
{
return $"Min ({this.m_VectorA}, {this.m_VectorB})";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}