public static BlobAssetReference <Collider> Create(IRenderService renderService)
        {
            NativeArray <float3> vertices = new NativeArray <float3>(
                renderService.GetVerticesArrayFloat3(),
                Allocator.TempJob
                );

            NativeArray <int3> triangles = new NativeArray <int3>(
                renderService.GetTrianglesArrayInt3(),
                Allocator.TempJob
                );

            BlobAssetReference <Collider> collider = Unity.Physics.MeshCollider.Create(vertices, triangles);

            triangles.Dispose();
            vertices.Dispose();

            return(collider);
        }
        public void Test_Create_HexMeshCollider()
        {
            // Set
            Vector3 vertex1 = new Vector3(0f, 0f, 0f);
            Vector3 vertex2 = new Vector3(0f, 0f, 2f);
            Vector3 vertex3 = new Vector3(2f, 0f, 0f);

            float3[] triangleVerticesFloat3 = new float3[] { vertex1, vertex2, vertex3 };
            int3[]   trianglesArrayInt3     = new int3[] { new int3(0, 1, 2) };

            IRenderService renderService = Substitute.For <IRenderService>();

            renderService.GetVerticesArrayFloat3().Returns(triangleVerticesFloat3);
            renderService.GetTrianglesArrayInt3().Returns(trianglesArrayInt3);

            // Action
            BlobAssetReference <Collider> collider = HexMeshCollider.Create(renderService);

            // Assertion
            Assert.That(collider, Is.Not.Null);
        }