Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class ChunkMeshLayerGroup

    Entity component that holds a group of ChunkMeshLayer instances, providing functionality to create, initialize, and manage them.

    Inheritance
    object
    HexTerrainLayer
    HexTerrainLayerGroup
    HexTerrainLayerGroup<ChunkMeshLayer>
    ChunkMeshLayerGroup
    Implements
    IDisposable
    ISerializableTerrainLayer
    IComponentData
    IQueryTypeParameter
    Inherited Members
    HexTerrainLayerGroup<ChunkMeshLayer>.LayersCount
    HexTerrainLayerGroup<ChunkMeshLayer>.Layers
    HexTerrainLayerGroup<ChunkMeshLayer>.LayersByName
    HexTerrainLayerGroup<ChunkMeshLayer>.LayerIndexByName
    HexTerrainLayerGroup<ChunkMeshLayer>.LayerIndexByInstance
    HexTerrainLayerGroup<ChunkMeshLayer>.Init<TInitLayerArgs>(HexTerrainSettings, IEnumerable<TInitLayerArgs>)
    HexTerrainLayerGroup<ChunkMeshLayer>.Init(HexTerrainSettings)
    HexTerrainLayerGroup<ChunkMeshLayer>.InitLayers<TInitLayerArgs>(HexTerrainSettings, IEnumerable<TInitLayerArgs>)
    HexTerrainLayerGroup<ChunkMeshLayer>.InitLayers(HexTerrainSettings)
    HexTerrainLayerGroup<ChunkMeshLayer>.GetLayer(int)
    HexTerrainLayerGroup<ChunkMeshLayer>.GetLayer(string)
    HexTerrainLayerGroup<ChunkMeshLayer>.CalculateColorMap(JobHandle)
    HexTerrainLayerGroup<ChunkMeshLayer>.GetLayer<TTargetLayer>(int, bool, string, bool)
    HexTerrainLayerGroup<ChunkMeshLayer>.GetLayer<TTargetLayer>(string)
    HexTerrainLayerGroup<ChunkMeshLayer>.GetLayer<TTargetLayer>(int)
    HexTerrainLayerGroup<ChunkMeshLayer>.GetLayer<TTargetLayer>(int, string)
    HexTerrainLayerGroup<ChunkMeshLayer>.GetLayer<TTargetLayer>()
    HexTerrainLayerGroup<ChunkMeshLayer>.GetLayer<TTargetLayer>(HexTerrainLayerReference)
    HexTerrainLayerGroup<ChunkMeshLayer>.SetOrAddLayer(int, ChunkMeshLayer, bool, bool)
    HexTerrainLayerGroup<ChunkMeshLayer>.SetLayer(int, ChunkMeshLayer, bool, bool)
    HexTerrainLayerGroup<ChunkMeshLayer>.AddLayer(ChunkMeshLayer)
    HexTerrainLayerGroup<ChunkMeshLayer>.RemoveLayer(int, bool)
    HexTerrainLayerGroup<ChunkMeshLayer>.RemoveLayer(string, bool)
    HexTerrainLayerGroup<ChunkMeshLayer>.RemoveLayer(ChunkMeshLayer, bool)
    HexTerrainLayerGroup<ChunkMeshLayer>.RegisterLayer(ChunkMeshLayer, int)
    HexTerrainLayerGroup<ChunkMeshLayer>.UnregisterLayer(ChunkMeshLayer, int)
    HexTerrainLayerGroup<ChunkMeshLayer>.SetAllDirty(bool)
    HexTerrainLayerGroup<ChunkMeshLayer>.Cleanup()
    HexTerrainLayerGroup<ChunkMeshLayer>.CleanupAsync(JobHandle)
    HexTerrainLayerGroup<ChunkMeshLayer>.Dispose()
    HexTerrainLayerGroup<ChunkMeshLayer>.SerializeLayer(BinaryWriter)
    HexTerrainLayerGroup<ChunkMeshLayer>.DeserializeLayer(BinaryReader, HexTerrainSettings)
    HexTerrainLayer.Name
    HexTerrainLayer.Settings
    HexTerrainLayer.ParentLayer
    HexTerrainLayer.Init<TInitArgs>(HexTerrainSettings, TInitArgs)
    HexTerrainLayer.Resize(int2)
    HexTerrainLayer.InitColoredDataLayer<TValue>(ColorMapCellValueDataLayer<TValue>, IInitColorMapCellValueDataLayerArgs<TValue>)
    HexTerrainLayer.InitDataLayer<TValue>(CellValueDataLayer<TValue>, IInitCellValueDataLayerArgs<TValue>)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(int)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(string)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(int, string)
    HexTerrainLayer.GetTerrainLayerFromParent<TLayer>(HexTerrainLayerReference)
    HexTerrainLayer.CompleteAllJobs()
    HexTerrainLayer.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Fwt.HexTerrains.ChunkMehes.Data
    Assembly: fwt.hexterrains.dll
    Syntax
    public class ChunkMeshLayerGroup : HexTerrainLayerGroup<ChunkMeshLayer>, IDisposable, ISerializableTerrainLayer, IComponentData, IQueryTypeParameter

    Methods

    CalcCellMetrics(JobHandle)

    Schedules the calculation of cell metrics for all layers, ensuring that the specified job dependency is respected.

    Declaration
    public virtual JobHandle CalcCellMetrics(JobHandle dependency)
    Parameters
    Type Name Description
    JobHandle dependency

    A job handle representing the dependency that must be completed before cell metric calculations begin.

    Returns
    Type Description
    JobHandle

    A job handle that can be used to ensure that the scheduled cell metric calculations are completed. If there are no layers, returns the original dependency.

    Remarks

    This method iterates through all layers and schedules their cell metric calculations, combining their dependencies with the provided job handle. If the Layers collection is null, no additional jobs are scheduled.

    CalcDirtyMeshSources(JobHandle)

    Calculates and schedules jobs to update mesh sources for all dirty layers, combining their dependencies with the specified job handle.

    Declaration
    public virtual JobHandle CalcDirtyMeshSources(JobHandle dependency)
    Parameters
    Type Name Description
    JobHandle dependency

    A job handle representing the dependency that must be completed before mesh source updates begin.

    Returns
    Type Description
    JobHandle

    A job handle that represents the combined dependencies of all scheduled mesh source update jobs and the specified dependency.

    Remarks

    If there are no layers to process, the method returns the input dependency unchanged. This method is intended for use in job-based update pipelines where mesh data may need to be recalculated or refreshed.

    CalcMeshSources(ChunksGridLayer, JobHandle)

    Calculates and schedules mesh source jobs for all visual chunk mesh layers in the current collection.

    Declaration
    public virtual JobHandle CalcMeshSources(ChunksGridLayer chunksGridLayer, JobHandle dependency)
    Parameters
    Type Name Description
    ChunksGridLayer chunksGridLayer

    The grid layer containing chunk data to be processed for mesh source generation.

    JobHandle dependency

    A job handle representing the dependency that must be completed before mesh source jobs are scheduled.

    Returns
    Type Description
    JobHandle

    A job handle that represents the combined dependencies of all scheduled mesh source jobs. If no layers are present, returns the input dependency.

    Remarks

    This method iterates through all layers in the collection and schedules mesh source jobs for those that are visual chunk mesh layers. The returned job handle can be used to ensure that all mesh source jobs have completed before proceeding.

    CreateChunkMeshes()

    Creates the mesh representations for all chunk layers in the collection.

    Declaration
    public virtual void CreateChunkMeshes()
    Remarks

    This method iterates through each layer in the Layers collection and invokes mesh creation for layers that support chunk meshes. If Layers is null, the method performs no action. Override this method to customize mesh creation behavior for derived types.

    CreateTerrainLayer<TInitArgs>(TInitArgs)

    This function is called to create a new terrain layer of type TTerrainLayer. Default implementation uses an Activator to create a new instance of TTerrainLayer, expecting that the TTerrainLayer has a parameterless constructor. Override this function in your derived class to have a custom way of creating a terrain layer.

    Declaration
    public override ChunkMeshLayer CreateTerrainLayer<TInitArgs>(TInitArgs initArgs)
    Parameters
    Type Name Description
    TInitArgs initArgs

    Initialization arguments for creating a layer

    Returns
    Type Description
    ChunkMeshLayer

    Returns a created instance of the terrain layer of type (inherited from) TTerrainLayer

    Type Parameters
    Name Description
    TInitArgs

    Init terrain layer arguments object that is used in create layer process. Default implementation ignores this parameter, but in your overrided implementation it may be needed

    Overrides
    HexTerrainLayerGroup<ChunkMeshLayer>.CreateTerrainLayer<TInitArgs>(TInitArgs)

    InitTerrainLayer<TInitArgs>(ChunkMeshLayer, HexTerrainSettings, TInitArgs)

    Initializes the terrain layer with the specified settings and initialization arguments.

    Declaration
    public override void InitTerrainLayer<TInitArgs>(ChunkMeshLayer layer, HexTerrainSettings settings, TInitArgs initArgs)
    Parameters
    Type Name Description
    ChunkMeshLayer layer

    nested terrain layer to be initialized with provided init args

    HexTerrainSettings settings

    HexTerrainSettings of the terrain this layers list is attached to

    TInitArgs initArgs

    Initialization arguments for provided nested terrain layer

    Type Parameters
    Name Description
    TInitArgs

    Initialization arguments for a nested terrain layer

    Overrides
    HexTerrainLayerGroup<ChunkMeshLayer>.InitTerrainLayer<TInitArgs>(ChunkMeshLayer, HexTerrainSettings, TInitArgs)

    Render(ChunksGridLayer, HexTerrainViewMode, LocalToWorld, Camera)

    Renders all visual chunk mesh layers using the specified parameters.

    Declaration
    public virtual void Render(ChunksGridLayer chunksGridLayer, HexTerrainViewMode viewMode, LocalToWorld terrainTransform, Camera camera)
    Parameters
    Type Name Description
    ChunksGridLayer chunksGridLayer

    ChunksGridLayer of the terrain

    HexTerrainViewMode viewMode

    view mode in which to render the terrain (which render config to use is dependent on this value)

    LocalToWorld terrainTransform

    transform of the terrain entity

    Camera camera

    camera to render the chunk meshes for

    SyncData(JobHandle)

    Synchronizes the data between different layers before the calculation of the CellMetrics..

    Declaration
    public virtual JobHandle SyncData(JobHandle dependency)
    Parameters
    Type Name Description
    JobHandle dependency

    A job handle representing the dependency that must be completed before synchronization begins.

    Returns
    Type Description
    JobHandle

    A job handle that can be used to track the completion of the synchronization operation. If there are no layers to synchronize, returns the original dependency.

    Remarks

    This method iterates through all layers and synchronizes their data based on the provided dependency. If a layer is null, it is skipped. The returned job handle can be used to ensure that all synchronization jobs have completed before proceeding.

    Implements

    IDisposable
    ISerializableTerrainLayer
    Unity.Entities.IComponentData
    Unity.Entities.IQueryTypeParameter

    Extension Methods

    HashExtensions.GetHashCode_RefType<TValue>(TValue, int)
    Extensions_UnityObject.SmartDestroy(object)
    Extensions_UnityObject.SmartGetComponent<TComponent>(object)
    Extensions_UnityObject.SmartGetGameGameObject(object)
    In this article
    Back to top Generated by DocFX