protected override void OnCreate()
        {
            var query = new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(CircleColliderComponent),
                    typeof(Translation)
                }
            };

            _circlesGroup = GetEntityQuery(query);

            query = new EntityQueryDesc
            {
                All = new ComponentType[]
                {
                    typeof(AABBColliderComponent),
                    typeof(Translation)
                }
            };

            _aabbGroup = GetEntityQuery(query);

            _barrier = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
        }
예제 #2
0
        protected override void OnCreate( )
        {
            // Cache the EndInitializationEntityCommandBufferSystem in a field, so we don't have to create it every frame
            eiecb = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem> ();

            SwitchMethods._Initialize( );
        }
예제 #3
0
    protected override void OnCreate()
    {
        m_beginBarrier = World.GetOrCreateSystem <BeginInitializationEntityCommandBufferSystem>();
        m_endBarrier   = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();

        foreach (var system in World.Active.Systems)
        {
            int depth = 0;
            var type  = system.GetType();
            if (SystemUtils.IsInSystem(system.GetType(), typeof(PresentationSystemGroup), ref depth))
            {
                if (depth > 1)
                {
                    var groups   = type.GetCustomAttributes(typeof(UpdateInGroupAttribute), true);
                    var group    = groups[0] as UpdateInGroupAttribute;
                    var groupSys = World.GetOrCreateSystem(group.GroupType) as ComponentSystemGroup;
                    groupSys.AddSystemToUpdateList(World.GetOrCreateSystem(type));
                    AddSystemToUpdateList(groupSys);
                }
                else
                {
                    AddSystemToUpdateList(World.GetOrCreateSystem(system.GetType()));
                }
            }
        }

        SortSystemUpdateList();
    }
예제 #4
0
 protected override void OnCreate()
 {
     base.OnCreate();
     random = new Random(52);
     GizmosDrawer.OnDrawGizmosSelectedAction += OnGiznos;
     beginSimulationEntityCBS = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
 }
 protected override void OnCreate()
 {
     base.OnCreate();
     m_entityQuery = GetEntityQuery(ComponentType.ReadWrite <Voxel>(), ComponentType.ReadWrite <ChunkModification>(),
                                    ComponentType.Exclude <ApplyMesh>(), ComponentType.Exclude <TriangulateChunk>());
     m_barrier = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
 }
예제 #6
0
 protected override void OnCreate()
 {
     _UnitQuery         = GetEntityQuery(typeof(UnitData));
     _SelectionSystem   = World.GetOrCreateSystem <SelectionSystem>();
     _ECBSystem         = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
     _BuildPhysicsWorld = World.GetOrCreateSystem <BuildPhysicsWorld>();
 }
        protected override void OnCreate()
        {
            m_barrier = World.GetExistingSystem <EndInitializationEntityCommandBufferSystem>( );

            GhostLookup = new NativeHashMap <int, Entity>(512, Allocator.Persistent);
            HashLookup  = new NativeHashMap <Entity, int>(512, Allocator.Persistent);
        }
        protected override void OnCreate( )
        {
            m_barrier = World.GetExistingSystem <EndInitializationEntityCommandBufferSystem>( );
            m_bodiesWithoutOwnerComponent = GetEntityQuery(m_bodiesServerControlledWithAuthorityFlagAssigned);

            RequireSingletonForUpdate <NetworkIdComponent>( );
        }
예제 #9
0
        protected override void OnCreate( )
        {
            Debug.Log("Start Add New Octree System");
            Debug.LogWarning("TODO: Replace instance with entity?");
            Debug.LogWarning("TODO: incomplete Get max bounds?");

            eiecb = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem> ();

            group = GetEntityQuery
                    (
                typeof(AddNewOctreeData)
                    );

            octreeArchetype = EntityManager.CreateArchetype
                              (
                ComponentType.Exclude <IsActiveTag> (),

                typeof(AddNewOctreeData),
                typeof(RootNodeData),

                // Add buffers.
                typeof(NodeBufferElement),
                typeof(NodeChildrenBufferElement),
                typeof(NodeInstancesIndexBufferElement),
                typeof(NodeSparesBufferElement),
                typeof(InstanceBufferElement),
                typeof(InstancesSpareIndexBufferElement),
                typeof(AddInstanceBufferElement),
                typeof(RemoveInstanceBufferElement)
                              );
        }
예제 #10
0
    protected override void OnCreate()
    {
        base.OnCreate();

        _random = new Random(81736);
        _entityCommandBufferSystem = World.GetExistingSystem <EndInitializationEntityCommandBufferSystem>();
    }
예제 #11
0
 protected override void OnCreateManager()
 {
     m_BeginEntityCommandBufferSystem = World.GetOrCreateManager <BeginInitializationEntityCommandBufferSystem>();
     m_EndEntityCommandBufferSystem   = World.GetOrCreateManager <EndInitializationEntityCommandBufferSystem>();
     m_systemsToUpdate.Add(m_BeginEntityCommandBufferSystem);
     m_systemsToUpdate.Add(m_EndEntityCommandBufferSystem);
 }
예제 #12
0
        protected override void OnCreate()
        {
            base.OnCreate();

            _barrier = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();

            _regionArchetype = EntityManager.CreateArchetype(typeof(Region), typeof(GenerateRegion));
        }
 protected override void OnCreate()
 {
     m_EntityCommandBufferSystem = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
     m_InitialTransformGroup     = GetEntityQuery(
         ComponentType.ReadOnly(typeof(CopyInitialTransformFromGameObject)),
         typeof(UnityEngine.Transform),
         ComponentType.ReadWrite <LocalToWorld>());
 }
예제 #14
0
        protected override void OnCreate()
        {
            _eventQuery = GetEntityQuery(ComponentType.ReadOnly <CreateChunkEventity>());

            _blockChunkArchetype = CreateBlockChunkArchetype();


            _updateEnd = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
        }
    protected override void OnCreate()
    {
        playersGroup = GetEntityQuery(ComponentType.ReadOnly <PlayerTag>(), ComponentType.ReadOnly <Translation>(), ComponentType.Exclude <IsDead>());
        enemyGroup   = GetEntityQuery(ComponentType.ReadOnly <EnemyTag>(), ComponentType.ReadOnly <Translation>(), ComponentType.Exclude <IsDead>());

        RequireForUpdate(playersGroup);
        RequireForUpdate(enemyGroup);

        endInitECBSystem = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
    }
예제 #16
0
    protected override void OnCreate()
    {
        entityCommandBuffer = World.GetExistingSystem <EndInitializationEntityCommandBufferSystem>();
        if (entityCommandBuffer == null)
        {
#if UNITY_EDITOR
            Debug.Log("GET DOWN! Problem incoming...");
#endif
        }

        weaponFired = new NativeQueue <WeaponInfo>(Allocator.Persistent);
    }
    protected override void OnCreate()
    {
        base.OnCreate();

        query = GetEntityQuery(
            ComponentType.ReadOnly <Transform>(),
            ComponentType.ReadOnly <LocalToWorld>(),
            ComponentType.ReadOnly <CopyInitialTransformToLocalToWorldTagCmp>()
            );

        barrier = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
    }
예제 #18
0
 protected override void OnCreate()
 {
     conf = Configuration.CreateFromJSON();
     quadrantMultiHashMap2    = QuadrantSystem.quadrantMultiHashMap;
     m_EndSimulationEcbSystem = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
     infectedCounter          = conf.numberOfInfects;
     symptomaticCounter       = 0;
     asymptomaticCounter      = 0;
     recoveredCounter         = 0;
     deathCounter             = 0;
     populationCounter        = conf.numberOfHumans;
     writer = new StreamWriter(logPath, false); // false is for overwrite existing file
     writer.WriteLine("Population\tExposed\tTotalExposed\tSymptomatic\tAsymptomatic\tDeath\tRecovered\tTotalRecovered\tMinutesPassed");
 }
예제 #19
0
        protected override void OnCreate( )
        {
            Debug.Log("Start Add New Octree Instance System");

            eiecb = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem> ();

            group = GetEntityQuery
                    (
                typeof(IsActiveTag),
                typeof(AddInstanceBufferElement),
                typeof(AddInstanceTag),
                typeof(RootNodeData)
                    );
        }
        protected override void OnCreate( )
        {
            Debug.Log("Start Octree Get Colliding Bounds Instances System");

            eiecb = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem> ();

            group = GetEntityQuery
                    (
                typeof(IsActiveTag),
                typeof(GetCollidingBoundsInstancesTag),
                typeof(OctreeEntityPair4CollisionData),
                typeof(BoundsData),
                typeof(IsCollidingData),
                typeof(CollisionInstancesBufferElement)
                // typeof (RootNodeData) // Unused in ray
                    );
        }
예제 #21
0
        protected override void OnCreate( )
        {
            Debug.Log("Start Octree Get Ray Colliding Instances System");

            eiecb = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem> ();

            group = GetEntityQuery
                    (
                typeof(IsActiveTag),
                typeof(GetCollidingRayInstancesTag),
                typeof(RayEntityPair4CollisionData),
                // typeof (RayData), // Not used by octree entity
                // typeof (RayMaxDistanceData), // Not used by octree entity
                typeof(IsCollidingData),
                typeof(CollisionInstancesBufferElement),
                typeof(RootNodeData)
                    );
        }
예제 #22
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);
            BeginInitializationEntityCommandBufferSystem beginEcbSys = null;
            EndInitializationEntityCommandBufferSystem   endEcbSys   = null;

            foreach (var s in m_systemsToUpdate)
            {
                if (s is BeginInitializationEntityCommandBufferSystem)
                {
                    beginEcbSys = (BeginInitializationEntityCommandBufferSystem)s;
                }
                else if (s is EndInitializationEntityCommandBufferSystem)
                {
                    endEcbSys = (EndInitializationEntityCommandBufferSystem)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);
            }

            if (endEcbSys != null)
            {
                finalSystemList.Add(endEcbSys);
            }
            m_systemsToUpdate = finalSystemList;
        }
        protected override void OnCreate()
        {
            base.OnCreate();
            _barier = World.DefaultGameObjectInjectionWorld
                      .GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
            var desc = new EntityQueryDesc
            {
                All = new[] { ComponentType.ReadWrite <Map>() }
            };

            query = EntityManager.CreateEntityQuery(desc);
            var tilesDesc = new EntityQueryDesc
            {
                All = new[] { ComponentType.ReadWrite <MapTile>() }
            };

            queryTiles    = EntityManager.CreateEntityQuery(tilesDesc);
            tileArchetype = EntityManager.CreateArchetype(ComponentType.ReadWrite <MapTile>());
            random        = new Random(42);
        }
예제 #24
0
    protected override void OnCreate()
    {
        _cameraMain = Camera.main;

        _unitSelectSystem = World.GetOrCreateSystem <UnitSelectSystem>();
        _ecbSystem        = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();

        _isFormationsHovered  = new NativeArray <bool>(MAX_FORMATIONS, Allocator.Persistent);
        _isFormationsSelected = new NativeArray <bool>(MAX_FORMATIONS, Allocator.Persistent);

        _unitQuery = GetEntityQuery(
            ComponentType.ReadOnly(typeof(FormationIndex)),
            ComponentType.ReadOnly(typeof(Translation))
            );

        _dragIndicatorQuery = GetEntityQuery(
            ComponentType.ReadOnly(typeof(DragIndicatorTag)),
            ComponentType.ReadOnly(typeof(FormationGroup))
            );
    }
예제 #25
0
        protected override void OnCreate()
        {
            base.OnCreate();

            m_PrefabsQuery = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[] {
                    ComponentType.ReadOnly <RegistryEventReferenceComponentData>(),
                    ComponentType.ReadOnly <Prefab>()
                }
            });

            m_EntitiesQuery = GetEntityQuery(new EntityQueryDesc
            {
                All = new ComponentType[] {
                    ComponentType.ReadOnly <RegistryEventReferenceComponentData>()
                }
            });


            m_EndInitializationEntityCommandBufferSystem = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
        }
예제 #26
0
        protected override void OnCreate()
        {
            _mesh = MeshCreator.Quad(EXTEND, quaternion.Euler(new float3(math.radians(90), 0, 0)));

            _pathTileArchetype = EntityManager.CreateArchetype(
                typeof(RenderMesh),
                typeof(LocalToWorld),
                typeof(Translation),
                typeof(RenderBounds),
                typeof(MainColorMaterialProperty)
                );

            _random = new Unity.Mathematics.Random();
            _random.InitState();

            _material = new Material(Shader.Find("Tile/AStarVisual"))
            {
                enableInstancing = true
            };

            _cmdBufferSystem = World.GetExistingSystem <EndInitializationEntityCommandBufferSystem>();
        }
예제 #27
0
 protected override void OnCreateManager()
 {
     // Cache the EndSimulationBarrier in a field, so we don't have to create it every frame
     m_EntityCommandBufferSystem = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
 }
예제 #28
0
 public override void InitSystem()
 {
     m_entityCommandBuffer = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
 }
예제 #29
0
 protected override void OnCreate()
 {
     _endInitializationEntityCommandBufferSystem =
         World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>();
 }
        protected override void OnCreate( )
        {
            Debug.LogWarning("Genetic Neural Network example manager started.");

            becb = World.GetOrCreateSystem <BeginInitializationEntityCommandBufferSystem> ();
            eecb = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem> ();

            em = World.EntityManager;

            group_MMMamager = EntityManager.CreateEntityQuery
                              (
                ComponentType.ReadOnly <IsAliveTag> (),
                ComponentType.ReadOnly <NNManagerComponent> (),

                ComponentType.Exclude <NNMangerIsSpawningNewGenerationTag> ()
                              );


            group_MMMamagerNotYetActive = EntityManager.CreateEntityQuery
                                          (
                ComponentType.ReadOnly <IsInitializedTag> (),
                ComponentType.ReadOnly <NNManagerComponent> (),


                ComponentType.Exclude <IsAliveTag> ()
                                          );


            group_prefabs = EntityManager.CreateEntityQuery
                            (
                ComponentType.ReadOnly <SpawnerPrefabs_FromEntityData> ()
                            );

            group_carSpawnerPoint = EntityManager.CreateEntityQuery
                                    (
                ComponentType.ReadOnly <CarSpawnerTag> ()
                                    );

            group_allPopulation = EntityManager.CreateEntityQuery
                                  (
                ComponentType.ReadOnly <NNBrainTag> (),

                ComponentType.ReadWrite <NNManagerSharedComponent> ()
                                  );

            group_firstPopulation = EntityManager.CreateEntityQuery
                                    (
                ComponentType.ReadOnly <IsAliveTag> (),

                ComponentType.ReadOnly <NNBrainTag> (),
                ComponentType.ReadOnly <NNIsFirstGenerationTag> (),

                ComponentType.ReadWrite <NNManagerSharedComponent> ()
                                    );

            group_need2InitializePopulation = EntityManager.CreateEntityQuery
                                              (
                // ComponentType.ReadOnly <NNIsFinishedTag> (), ...

                ComponentType.ReadOnly <NNBrainTag> (),

                ComponentType.Exclude <IsAliveTag> (),
                ComponentType.Exclude <IsSpawningTag> (),
                ComponentType.Exclude <NNIsPreviousGenerationTag> (),

                ComponentType.ReadWrite <NNManagerSharedComponent> ()
                                              );

            group_currentPopulation = EntityManager.CreateEntityQuery
                                      (
                ComponentType.ReadOnly <IsAliveTag> (),
                // ComponentType.ReadOnly <NNIsFinishedTag> (), ...

                ComponentType.ReadOnly <NNBrainTag> (),
                ComponentType.Exclude <NNIsPreviousGenerationTag> (),

                ComponentType.ReadWrite <NNManagerSharedComponent> ()
                                      );

            group_finishedPopulation = EntityManager.CreateEntityQuery
                                       (
                ComponentType.ReadOnly <IsAliveTag> (),
                // ComponentType.ReadOnly <NNIsFinishedTag> (), ...

                ComponentType.ReadOnly <NNBrainTag> (),
                ComponentType.ReadOnly <NNIsFinishedTag> (),
                // ComponentType.ReadOnly <NNIsFinishedTag> (),
                ComponentType.Exclude <NNIsPreviousGenerationTag> (),
                ComponentType.Exclude <NNIsFirstGenerationTag> (),

                ComponentType.ReadWrite <NNManagerSharedComponent> ()
                                       );

            group_previousGeneration = EntityManager.CreateEntityQuery
                                       (
                ComponentType.ReadOnly <IsAliveTag> (),
                // ComponentType.ReadOnly <NNIsFinishedTag> (),

                ComponentType.ReadOnly <NNBrainTag> (),
                ComponentType.ReadOnly <NNIsPreviousGenerationTag> (),

                ComponentType.ReadWrite <NNManagerSharedComponent> ()
                                       );


            _DefineLayersNuronsCount(ref layersNeuronCounts);

            random = new Unity.Mathematics.Random((uint)System.DateTime.UtcNow.Millisecond + 5000);

            jsonNeuralNetworkMangers = new ManagerMethods.JsonNeuralNetworkMangers();
        }