示例#1
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var rectTransformType       = GetArchetypeChunkComponentType <RectTransform>(true);
            var entityType              = GetArchetypeChunkEntityType();
            var childType               = GetArchetypeChunkBufferType <UIChild>(true);
            var childFromEntity         = GetBufferFromEntity <UIChild>(true);
            var localToWorldFromEntity  = GetComponentDataFromEntity <WorldSpaceRect>();
            var rectTransformFromEntity = GetComponentDataFromEntity <RectTransform>(true);
            var rebuildFlagType         = GetComponentDataFromEntity <RebuildElementMeshFlag>();

            var dpi = ScreenUtils.GetScaledDpi();
            var updateHierarchyJob = new UpdateHierarchy
            {
                Dpi                      = new float2(dpi, dpi),
                ScreenWidth              = Screen.width,
                ScreenHeight             = Screen.height,
                RectTransformType        = rectTransformType,
                EntityType               = entityType,
                ChildType                = childType,
                ChildFromEntity          = childFromEntity,
                LocalToWorldFromEntity   = localToWorldFromEntity,
                RectTransformFromEntity  = rectTransformFromEntity,
                RebuildFlagType          = rebuildFlagType,
                ElementScaleType         = GetComponentDataFromEntity <ElementScale>(),
                ConstantPhysicalScaler   = GetArchetypeChunkComponentType <CanvasConstantPhysicalSizeScaler>(true),
                ConstantPixelScaler      = GetArchetypeChunkComponentType <CanvasConstantPixelSizeScaler>(true),
                WorldSpaceMaskFromEntity = GetComponentDataFromEntity <WorldSpaceMask>(),
                RectMaskFromEntity       = GetComponentDataFromEntity <RectMask>(true)
            };
            var updateHierarchyJobHandle = updateHierarchyJob.Schedule(m_Group, inputDeps);

            updateHierarchyJobHandle.Complete();
            return(updateHierarchyJobHandle);
        }
示例#2
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var entityType               = GetArchetypeChunkEntityType();
            var childType                = GetArchetypeChunkBufferType <Child>(true);
            var childFromEntity          = GetBufferFromEntity <Child>(true);
            var worldSpaceRectFromEntity = GetComponentDataFromEntity <WorldSpaceRect>();
            var rectTransformFromEntity  = GetComponentDataFromEntity <RectTransform>(true);
            var rebuildFlagType          = GetComponentDataFromEntity <RebuildElementMeshFlag>();

            var dpi = ScreenUtils.GetScaledDpi();
            var updateHierarchyJob = new UpdateHierarchy
            {
                Dpi = new float2(dpi, dpi),
                RectTransformType      = GetArchetypeChunkComponentType <RectTransform>(true),
                CanvasSizeType         = GetArchetypeChunkComponentType <CanvasScreenSize>(true),
                EntityType             = entityType,
                ChildType              = childType,
                ConstantPhysicalScaler = GetArchetypeChunkComponentType <CanvasConstantPhysicalSizeScaler>(true),
                ConstantPixelScaler    = GetArchetypeChunkComponentType <CanvasConstantPixelSizeScaler>(true),
                RebuildContext         = new HierarchyRebuildContext()
                {
                    ChildrenFromEntity       = childFromEntity,
                    WorldSpaceRectFromEntity = worldSpaceRectFromEntity,
                    RectTransformFromEntity  = rectTransformFromEntity,
                    RebuildFlagFromEntity    = rebuildFlagType,
                    ElementScaleFromEntity   = GetComponentDataFromEntity <ElementScale>(),
                    WorldSpaceMaskFromEntity = GetComponentDataFromEntity <WorldSpaceMask>(),
                    RectMaskFromEntity       = GetComponentDataFromEntity <RectMask>(true)
                }
            };
            var updateHierarchyJobHandle = updateHierarchyJob.Schedule(m_Group, inputDeps);

            return(updateHierarchyJobHandle);
        }
示例#3
0
        protected override JobHandle OnUpdate(JobHandle inputDeps)
        {
            var entityType = GetArchetypeChunkEntityType();
            var childType  = GetArchetypeChunkBufferType <Child>(true);

            var dpi = ScreenUtils.GetScaledDpi();
            var updateHierarchyJob = new UpdateHierarchy
            {
                Dpi = new float2(dpi, dpi),
                RectTransformType      = GetArchetypeChunkComponentType <RectTransform>(true),
                CanvasSizeType         = GetArchetypeChunkComponentType <CanvasScreenSize>(true),
                EntityType             = entityType,
                ChildType              = childType,
                ConstantPhysicalScaler = GetArchetypeChunkComponentType <CanvasConstantPhysicalSizeScaler>(true),
                ConstantPixelScaler    = GetArchetypeChunkComponentType <CanvasConstantPixelSizeScaler>(true),
                RebuildContext         = HierarchyRebuildContext.Create(this)
            };
            var updateHierarchyJobHandle = updateHierarchyJob.Schedule(m_Group, inputDeps);

            return(updateHierarchyJobHandle);
        }