Пример #1
0
    public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
    {
        BlobDataRef blobDataComponent = new BlobDataRef();

        blobDataComponent.blobData = CreateBlobData();

        dstManager.AddComponentData(entity, blobDataComponent);
    }
        private bool GetPatchTarget(void *address, out BlobDataRef blobDataRef)
        {
            // Search backwards; most likely to be referring to objects that were most recently added..
            for (int i = m_allocations.Length - 1; i >= 0; i--)
            {
                var allocation = m_allocations[i];
                if (address >= allocation.p && address < (allocation.p + allocation.size))
                {
                    blobDataRef = new BlobDataRef
                    {
                        allocIndex = i,
                        offset     = (int)((byte *)address - allocation.p),
                    };

                    return(true);
                }
            }

            blobDataRef = default;
            return(false);
        }
Пример #3
0
 void *AllocationToPointer(BlobDataRef blobDataRef)
 {
     return(m_allocations[blobDataRef.allocIndex].p + blobDataRef.offset);
 }