Esempio n. 1
0
        private void ProcessEntity(Entity entity, EntityCommandBuffer ecb)
        {
            RegistryEventReferenceComponentData registryEventReference = EntityManager.GetComponentData <RegistryEventReferenceComponentData>(entity);

            foreach (ISelfRegistringAuhtoringComponent e in registryEventReference.listOfManagedBuffer)
            {
                e.Register(ecb, entity);
            }

            ecb.RemoveComponent(entity, typeof(RegistryEventReferenceComponentData));
        }
Esempio n. 2
0
        public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
        {
            if (!dstManager.HasComponent <RegistryEventReferenceComponentData>(entity))
            {
                dstManager.AddComponentData(entity, new RegistryEventReferenceComponentData());
            }

            RegistryEventReferenceComponentData component = dstManager.GetComponentData <RegistryEventReferenceComponentData>(entity);

            List <ELEMENT> elems = new List <ELEMENT>();

            foreach (AUTHORING entry in Entries)
            {
                elems.Add(entry.Entry);
            }

            RegistryEventComponentDataElement <ELEMENT, BUFFER> elem = new EFFECT_COMPONENT_DATA_ELEMENT();

            elem.SetElementList(elems);
            component.listOfManagedBuffer.Add(elem);
            dstManager.SetComponentData(entity, component);
        }