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>(); }
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( ); }
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(); }
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>(); }
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>( ); }
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) ); }
protected override void OnCreate() { base.OnCreate(); _random = new Random(81736); _entityCommandBufferSystem = World.GetExistingSystem <EndInitializationEntityCommandBufferSystem>(); }
protected override void OnCreateManager() { m_BeginEntityCommandBufferSystem = World.GetOrCreateManager <BeginInitializationEntityCommandBufferSystem>(); m_EndEntityCommandBufferSystem = World.GetOrCreateManager <EndInitializationEntityCommandBufferSystem>(); m_systemsToUpdate.Add(m_BeginEntityCommandBufferSystem); m_systemsToUpdate.Add(m_EndEntityCommandBufferSystem); }
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>()); }
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>(); }
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>(); }
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"); }
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 ); }
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) ); }
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); }
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)) ); }
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>(); }
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>(); }
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>(); }
public override void InitSystem() { m_entityCommandBuffer = World.GetOrCreateSystem <EndInitializationEntityCommandBufferSystem>(); }
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(); }