示例#1
0
    protected override void OnCreate()
    {
        base.OnCreate();
        m_GraphSystem = World.GetOrCreateSystem <AnimationGraphSystem>();
        m_GraphSystem.AddRef();

        if (m_GraphSystem.Set.RendererModel != RenderExecutionModel.Islands)
        {
            m_GraphSystem.Set.RendererModel = RenderExecutionModel.Islands;
        }

        m_CreateLambda = (Entity e, ref TSampleSetup setup) =>
        {
            var data = CreateGraph(e, m_GraphSystem.Set, ref setup);
            PostUpdateCommands.AddComponent(e, data);
        };

        m_DestroyLambda = (Entity e, ref TSampleData data) =>
        {
            DestroyGraph(e, m_GraphSystem.Set, ref data);
            PostUpdateCommands.RemoveComponent(e, typeof(TSampleData));
        };

        m_UpdateLambda = (Entity e, ref TSampleData data) =>
        {
            UpdateGraph(e, m_GraphSystem.Set, ref data);
        };
    }
 protected override void OnCreate()
 {
     _resourcesMapping  = World.GetOrCreateSystem <RenderingResourcesMappingSystem>();
     _meshesForCreating = GetEntityQuery(
         ComponentType.ReadOnly <FlatMeshBlobComponent>(),
         ComponentType.Exclude <MeshInitialized>());
     _removedMeshes = GetEntityQuery(
         ComponentType.Exclude <FlatMeshBlobComponent>(),
         ComponentType.ReadOnly <MeshInitialized>());
     _cachedForEach = CreateMeshFromMeshData;
 }
        protected override void OnCreate()
        {
            base.OnCreate();

            portalQuerySet = new EntityQuerySet(GetEntityQuery(
                                                    ComponentType.ReadOnly <StrategyHexAccessPortal.Component>()
                                                    ), frequency);

            portalAction    = PortalQuery;
            this.hexIndexes = new Dictionary <uint, HexIndexPower>();
            this.frontHexes = new Dictionary <UnitSide, FrontHexInfo>();
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            unitQuerySet = new EntityQuerySet(GetEntityQuery(
                                                  ComponentType.ReadWrite <BaseUnitStatus.Component>(),
                                                  ComponentType.ReadOnly <BaseUnitStatus.HasAuthority>(),
                                                  ComponentType.ReadOnly <Position.Component>(),
                                                  ComponentType.ReadOnly <Rigidbody>()
                                                  ), frequency);
            unitAction = UnitQuery;

            portalQuerySet = new EntityQuerySet(GetEntityQuery(
                                                    ComponentType.ReadOnly <StrategyHexAccessPortal.Component>()
                                                    ), frequency);

            portalAction = PortalQuery;
        }
示例#5
0
    protected override void OnCreate()
    {
        base.OnCreate();
        m_GraphSystem = World.GetOrCreateSystem <TAnimationGraph>();
        m_GraphSystem.AddRef();
        m_GraphSystem.Set.RendererModel = NodeSet.RenderExecutionModel.Islands;

        m_CreateLambda = (Entity e, ref Rig rig, ref TSampleSetup setup) =>
        {
            var data = CreateGraph(e, ref rig, m_GraphSystem, ref setup);
            PostUpdateCommands.AddComponent(e, data);
        };

        m_DestroyLambda = (Entity e, ref TSampleData data) =>
        {
            DestroyGraph(e, m_GraphSystem, ref data);
            PostUpdateCommands.RemoveComponent <TSampleData>(e);
        };
    }
示例#6
0
        protected override void OnCreate()
        {
            bulletQuery = GetEntityQuery(
                ComponentType.ReadWrite <Transform>(),
                ComponentType.ReadOnly <LongRangeBulletComponent.Component>());

            missileQuery = GetEntityQuery(
                ComponentType.ReadWrite <LongRangeBulletComponent.Component>(),
                ComponentType.ReadOnly <GuidComponent.Component>());

            gravityQuery = GetEntityQuery(
                ComponentType.ReadWrite <LongRangeBulletComponent.Component>(),
                ComponentType.Exclude <GuidComponent.Component>());

            bulletAction  = BulletQuery;
            missileAction = MissileQuery;
            gravityAction = GravityQuery;

            deltaTime = 0.0f;
        }
        protected override void OnCreate()
        {
            base.OnCreate();

            portalGroup = GetEntityQuery(
                ComponentType.ReadWrite <StrategyHexAccessPortal.Component>(),
                ComponentType.ReadOnly <StrategyHexAccessPortal.HasAuthority>()
                );

            facilityGroup = GetEntityQuery(
                ComponentType.ReadOnly <HexFacility.Component>(),
                ComponentType.ReadOnly <BaseUnitStatus.Component>(),
                ComponentType.ReadOnly <SpatialEntityId>()
                );

            interAccess = IntervalCheckerInitializer.InitializedChecker(frequencyManager);

            portalQuery   = PortalQuery;
            facilityQuery = FacilityQuery;
        }
        [Test, Ignore("CreateArchetypeChunkArray allocs GC")] // this is due to safety sentinels; move to release build playmode test
        public void ForEachSecondRun_DoesNotAlloc()
        {
            EntityQueryBuilder.F_ED <EcsTestData> emptyFunc = (Entity e, ref EcsTestData d) => { };

            ValidateNoGCAllocs(() => TestSystem.Entities.ForEach(emptyFunc));
        }