Esempio n. 1
0
        protected override void OnCreateManager()
        {
            m_ColorSizeParticleArchetype = EntityManager.CreateArchetype(typeof(ParticleEmitterComponentData),
                                                                         typeof(ParticleComponentData),
                                                                         typeof(ParticleAgeComponentData), typeof(ParticleVelocityComponentData),
                                                                         typeof(Translation), typeof(Rotation),
                                                                         typeof(ParticleColorTransitionComponentData), typeof(ParticleSizeTransitionComponentData));
            m_ColorParticleArchetype = EntityManager.CreateArchetype(typeof(ParticleEmitterComponentData),
                                                                     typeof(ParticleComponentData),
                                                                     typeof(ParticleAgeComponentData), typeof(ParticleVelocityComponentData),
                                                                     typeof(Translation), typeof(Rotation),
                                                                     typeof(ParticleColorTransitionComponentData));
            m_SizeParticleArchetype = EntityManager.CreateArchetype(typeof(ParticleEmitterComponentData),
                                                                    typeof(ParticleComponentData),
                                                                    typeof(ParticleAgeComponentData), typeof(ParticleVelocityComponentData),
                                                                    typeof(Translation), typeof(Rotation),
                                                                    typeof(ParticleSizeTransitionComponentData));
            m_ParticleArchetype = EntityManager.CreateArchetype(typeof(ParticleEmitterComponentData),
                                                                typeof(ParticleComponentData),
                                                                typeof(ParticleAgeComponentData), typeof(ParticleVelocityComponentData),
                                                                typeof(Translation), typeof(Rotation));

            barrier         = World.GetOrCreateManager <BeginPresentationEntityCommandBufferSystem>();
            spawnCountQueue = new NativeQueue <int>(Allocator.Persistent);

            EntityManager.CreateEntity(typeof(ParticleSpawnCountComponent));
        }
Esempio n. 2
0
 /// <summary>
 /// Need to call base.OnCreate() at start of the function.
 /// </summary>
 protected override void OnCreate()
 {
     beginInitializationBuffer = World.GetExistingSystem <BeginInitializationEntityCommandBufferSystem>();
     beginSimulationBuffer     = World.GetExistingSystem <BeginSimulationEntityCommandBufferSystem>();
     endSimulationBuffer       = World.GetExistingSystem <EndSimulationEntityCommandBufferSystem>();
     beginPresentationBuffer   = World.GetExistingSystem <BeginPresentationEntityCommandBufferSystem>();
 }
Esempio n. 3
0
        public override void SortSystemUpdateList()
        {
            // Extract list of systems to sort (excluding built-in systems that are inserted at fixed points)
            var toSort = new List <ComponentSystemBase>(m_systemsToUpdate.Count);
            BeginPresentationEntityCommandBufferSystem beginEcbSys = null;

#pragma warning disable 0618
#pragma warning restore 0618
            foreach (var s in m_systemsToUpdate)
            {
                if (s is BeginPresentationEntityCommandBufferSystem)
                {
                    beginEcbSys = (BeginPresentationEntityCommandBufferSystem)s;
                }
                else
                {
                    toSort.Add(s);
                }
            }
            m_systemsToUpdate = toSort;
            base.SortSystemUpdateList();
            // Re-insert built-in systems to construct the final list
            var finalSystemList = new List <ComponentSystemBase>(toSort.Count);
            if (beginEcbSys != null)
            {
                finalSystemList.Add(beginEcbSys);
            }
            foreach (var s in m_systemsToUpdate)
            {
                finalSystemList.Add(s);
            }
            m_systemsToUpdate = finalSystemList;
        }
Esempio n. 4
0
 protected override void OnCreate()
 {
     m_BeginEntityCommandBufferSystem = World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();
     m_EndEntityCommandBufferSystem   = World.GetOrCreateSystem <EndPresentationEntityCommandBufferSystem>();
     m_systemsToUpdate.Add(m_BeginEntityCommandBufferSystem);
     m_systemsToUpdate.Add(m_EndEntityCommandBufferSystem);
 }
Esempio n. 5
0
    protected override void OnCreate()
    {
        beginPresentationEntityCommandBufferSystem = World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();

        m_Query = GetEntityQuery(ComponentType.ReadOnly <DeleteEntityEvent>());

        base.OnCreate();
    }
Esempio n. 6
0
 protected override void OnCreate()
 {
     cmdBufferSystem = World.DefaultGameObjectInjectionWorld.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();
     disposalGroup   = GetEntityQuery(new EntityQueryDesc {
         All  = new ComponentType[] { typeof(T) },
         None = new ComponentType[] { typeof(UnmanagedMemTag) }
     });
 }
Esempio n. 7
0
    protected override void OnCreate()
    {
        base.OnCreate();

        _newSimEntitiesQ = SimWorldAccessor.CreateEntityQuery(ComponentType.ReadOnly <NewlyCreatedTag>(), ComponentType.ReadOnly <BlueprintId>());
        _ecbSystem       = World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();

        RequireSingletonForUpdate <BlobAssetReferenceComponent <ViewBindingSystemSettings> >();
    }
Esempio n. 8
0
        protected override void OnCreateManager()
        {
            randomData = new NativeArray <float>(10 * 1024, Allocator.Persistent);
            for (int i = 0; i < randomData.Length; ++i)
            {
                randomData[i] = Random.Range(0.0f, 1.0f);
            }
            randomDataBase = 0;

            barrier = World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();
        }
Esempio n. 9
0
#pragma warning restore 0618

        protected override void OnCreate()
        {
            m_BeginEntityCommandBufferSystem = World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();

#pragma warning disable 0618
            // warning CS0618: 'EndPresentationEntityCommandBufferSystem' is obsolete
            m_EndEntityCommandBufferSystem = World.GetOrCreateSystem <EndPresentationEntityCommandBufferSystem>();
#pragma warning restore 0618

            m_systemsToUpdate.Add(m_BeginEntityCommandBufferSystem);
            m_systemsToUpdate.Add(m_EndEntityCommandBufferSystem);
        }
Esempio n. 10
0
 protected override void OnCreate()
 {
     m_Group = GetEntityQuery(ComponentType.ReadWrite <EnergyStore>(),
                              ComponentType.ReadWrite <TxAutotrophPhenotype>(),
                              ComponentType.ReadOnly <TxAutotrophChrome1W>(),
                              ComponentType.ReadOnly <TxAutotrophParts>()
                              );
     petalGroup = GetEntityQuery(
         ComponentType.ReadOnly <EnergyStore>(),
         ComponentType.ReadOnly <TxAutotrophMeshes>()
         );
     m_BeginPresentationEcbSystem = World
                                    .GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();
 }
Esempio n. 11
0
    protected override void OnCreate()
    {
        base.OnCreate();
        m_EntityCommandBufferSystem                  = World.GetOrCreateSystem <BeginSimulationEntityCommandBufferSystem>();
        m_EntityCommandBufferSystemo                 = World.GetOrCreateSystem <EndFixedStepSimulationEntityCommandBufferSystem>();
        m_EndFramePhysicsSystem                      = World.GetExistingSystem <EndFramePhysicsSystem>();
        m_endSimulationEntityCommandBufferSystem     = World.GetExistingSystem <EndSimulationEntityCommandBufferSystem>();
        m_beginPresentationEntityCommandBufferSystem = World.GetExistingSystem <BeginPresentationEntityCommandBufferSystem>();

        _query              = GetEntityQuery(typeof(MoveStats));
        _queryInput         = GetEntityQuery(typeof(InputComponent));
        _dalleQuery         = GetEntityQuery(typeof(Selectable), typeof(Player1));
        _dalleSelectedQuery = GetEntityQuery(typeof(Selectable), typeof(Player1), typeof(UnitSelected), typeof(GrisTag));
    }
Esempio n. 12
0
        protected override void OnCreate()
        {
            base.OnCreate();

            // _entityCommandBufferSystem = World.GetOrCreateSystem<BeginSimulationEntityCommandBufferSystem>();
            _entityCommandBufferSystem = World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();

            _mapQuery = GetEntityQuery(
                ComponentType.ReadOnly <MapData>(),
                ComponentType.ReadOnly <MapTileBuffer>());

            _visualMapQuery = GetEntityQuery(
                ComponentType.ReadOnly <VisualMapData>(),
                typeof(RenderMesh));

            RequireForUpdate(_mapQuery);
            RequireForUpdate(_visualMapQuery);
        }
Esempio n. 13
0
 protected override void OnCreateManager()
 {
     m_beginBarrier = World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();
     m_endBarrier   = World.GetOrCreateSystem <EndPresentationEntityCommandBufferSystem>();
 }
 protected override void OnStartRunning()
 {
     ecbSystem = World.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();
 }
 protected override void OnCreate()
 {
     cmdBufferSystem = World.Active.GetOrCreateSystem <BeginPresentationEntityCommandBufferSystem>();
 }
 protected override void OnCreateManager()
 {
     barrier = World.GetOrCreateManager <BeginPresentationEntityCommandBufferSystem>();
 }
Esempio n. 17
0
 protected override void OnCreate()
 {
     ValidDagDepths      = new List <DagDepth>();
     _beginPresEcbSystem = World.GetExistingSystem <BeginPresentationEntityCommandBufferSystem>();
 }