示例#1
0
        public static BlobAssetReference <QuadTree> CreateBlobAssetReference()
        {
            using (var builder = new BlobBuilder(Allocator.Temp)) {
                ref var rootQuadTree = ref builder.ConstructRoot <QuadTree>();

                var colliders = builder.Allocate(ref rootQuadTree.Colliders, 2);
                LineCollider.Create(builder, ref colliders[0], new float2(1f, 20f), new float2(3f, 4f), 5f, 6f);
                PointCollider.Create(builder, ref colliders[1], new float3(7f, 8f, 9f));

                return(builder.CreateBlobAssetReference <QuadTree>(Allocator.Persistent));
            }