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.
30 lines
677 B
30 lines
677 B
9 years ago
|
using System;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
namespace UnityTest
|
||
|
{
|
||
|
public class ColliderComparer : ComparerBaseGeneric<Bounds>
|
||
|
{
|
||
|
public enum CompareType
|
||
|
{
|
||
|
Intersects,
|
||
|
DoesNotIntersect
|
||
|
};
|
||
|
|
||
|
public CompareType compareType;
|
||
|
|
||
|
protected override bool Compare(Bounds a, Bounds b)
|
||
|
{
|
||
|
switch (compareType)
|
||
|
{
|
||
|
case CompareType.Intersects:
|
||
|
return a.Intersects(b);
|
||
|
case CompareType.DoesNotIntersect:
|
||
|
return !a.Intersects(b);
|
||
|
}
|
||
|
throw new Exception();
|
||
|
}
|
||
|
}
|
||
|
}
|