Skip to content

Commit

Permalink
Reference SpatialHashModule to prevent it from getting stripped on IL…
Browse files Browse the repository at this point in the history
…2CPP
  • Loading branch information
mtschoen-unity committed Sep 1, 2020
1 parent eeafab7 commit 13a0fd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Runtime/Scripts/Core/EditorXR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Unity.EditorXR.Modules;
using Unity.EditorXR.Utilities;
using Unity.XRTools.ModuleLoader;
using Unity.XRTools.SpatialHash.Internal;
using Unity.XRTools.Utils;
using UnityEngine;

Expand Down Expand Up @@ -202,5 +203,11 @@ public void UnloadModule()
activeView.Close();
#endif
}

static EditorXR()
{
// Hack: Required to preserve class which is not explicitly accessed
new SpatialHashModule();
}
}
}
3 changes: 2 additions & 1 deletion Runtime/Unity.Labs.EditorXR.asmdef
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"Unity.XRTools.ModuleLoader",
"Unity.EditorXR.Interfaces",
"UnityEngine.SpatialTracking",
"Unity.XRTools.SpatialHash.Public"
"Unity.XRTools.SpatialHash.Public",
"Unity.XRTools.SpatialHash"
],
"optionalUnityReferences": [],
"includePlatforms": [],
Expand Down

0 comments on commit 13a0fd4

Please sign in to comment.