An easy to use Unity 3D library for creating illustrated Interactive Fiction games and more.
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.

39 lines
1.1 KiB

using System;
using System.Collections.Generic;
using UnityEngine;
namespace UnityTest
{
public class Vector4Comparer : VectorComparerBase<Vector4>
{
public enum CompareType
{
MagnitudeEquals,
MagnitudeNotEquals
}
public CompareType compareType;
public double floatingPointError;
protected override bool Compare(Vector4 a, Vector4 b)
{
switch (compareType)
{
case CompareType.MagnitudeEquals:
return AreVectorMagnitudeEqual(a.magnitude,
b.magnitude,
floatingPointError);
case CompareType.MagnitudeNotEquals:
return !AreVectorMagnitudeEqual(a.magnitude,
b.magnitude,
floatingPointError);
}
throw new Exception();
}
public override int GetDepthOfSearch()
{
return 3;
}
}
}