示例#1
0
        public InstantiateCommandBuffer <T0, T1> CreateInstantiateCommandBuffer <T0, T1>() where T0 : unmanaged, IComponentData where T1 : unmanaged, IComponentData
        {
            //Todo: We use Persistent allocator here for consistency, though I suspect it might be possible to improve this.
            var icb      = new InstantiateCommandBuffer <T0, T1>(Allocator.Persistent);
            var instance = new PlaybackInstance
            {
                type = PlaybackType.InstantiateUntyped,
                requestingSystemType = World.ExecutingSystemType(),
            };

            m_playbackInstances.Add(instance);
            m_instantiateCommandBuffersUntyped.Add(icb.m_instantiateCommandBufferUntyped);
            return(icb);
        }
示例#2
0
        public InstantiateCommandBuffer CreateInstantiateCommandBuffer()
        {
            //Todo: We use Persistent allocator here for consistency, though I suspect it might be possible to improve this.
            var icb      = new InstantiateCommandBuffer(Allocator.Persistent);
            var instance = new PlaybackInstance
            {
                type = PlaybackType.InstantiateNoData,
                requestingSystemType = World.ExecutingSystemType(),
            };

            m_playbackInstances.Add(instance);
            m_instantiateCommandBuffersWithoutData.Add(icb);
            return(icb);
        }