namespace Zinnia.Rule
{
using UnityEngine;
using Zinnia.Extension;
///
/// Determines whether a given is equal to the within a .
///
public class Vector3EqualsRule : Vector3Rule
{
[Tooltip("The Vector3 to check equality against.")]
[SerializeField]
private Vector3 target;
///
/// The to check equality against.
///
public Vector3 Target
{
get
{
return target;
}
set
{
target = value;
}
}
[Tooltip("The tolerance between the two Vector3 values that can be considered equal.")]
[SerializeField]
private float tolerance = float.Epsilon;
///
/// The tolerance between the two values that can be considered equal.
///
public float Tolerance
{
get
{
return tolerance;
}
set
{
tolerance = value;
}
}
///
protected override bool Accepts(Vector3 targetVector3)
{
return targetVector3.ApproxEquals(Target, Tolerance);
}
}
}