Skip to content

Commit 1c31885

Browse files
authored
Update CameraFOVChecker.cs to fix .NET build in Unity 2018 (#10654)
Update CameraFOVChecker.cs
1 parent 6884b43 commit 1c31885

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Assets/MRTK/Core/Utilities/CameraFOVChecker.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ public static class CameraFOVChecker
1515
{
1616
// Help to clear caches when new frame runs
1717
private static int inFOVLastCalculatedFrame = -1;
18+
#if !NETFX_CORE
1819
// Map from grabbable => is the grabbable in FOV for this frame. Cleared every frame
1920
private static Dictionary<ValueTuple<Collider, Camera>, bool> inFOVColliderCache = new Dictionary<ValueTuple<Collider, Camera>, bool>();
21+
#else
22+
private static Dictionary<Tuple<Collider, Camera>, bool> inFOVColliderCache = new Dictionary<Tuple<Collider, Camera>, bool>();
23+
#endif
2024
// List of corners shared across all sphere pointer query instances --
2125
// used to store list of corners for a bounds. Shared and static
2226
// to avoid allocating memory each frame
@@ -37,7 +41,12 @@ public static bool IsInFOVCached(this Camera cam, Collider myCollider)
3741
return false;
3842
}
3943

44+
#if !NETFX_CORE
4045
ValueTuple<Collider, Camera> cameraColliderPair = ValueTuple.Create(myCollider, cam);
46+
#else
47+
Tuple<Collider, Camera> cameraColliderPair = Tuple.Create(myCollider, cam);
48+
#endif
49+
4150
bool result;
4251
if (inFOVLastCalculatedFrame != Time.frameCount)
4352
{

0 commit comments

Comments
 (0)