You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 lines
1.0 KiB

using UnityEngine;
namespace UnityEditor.VFX.Operator
{
[VFXHelpURL("Operator-Distance")]
[VFXInfo(category = "Math/Vector")]
class Distance : VFXOperatorNumericUniform
{
public class InputProperties
{
[Tooltip("The first operand.")]
public Vector3 a = Vector3.zero;
[Tooltip("The second operand.")]
public Vector3 b = Vector3.zero;
}
public class OutputProperties
{
[Tooltip("The distance between a and b.")]
public float d;
}
protected override sealed string operatorName { get { return "Distance"; } }
protected override ValidTypeRule typeFilter
{
get
{
return ValidTypeRule.allowEverythingExceptInteger;
}
}
protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
{
return new[] { VFXOperatorUtility.Distance(inputExpression[0], inputExpression[1]) };
}
}
}