Hex Terrains Framework
Search Results for

    Show / Hide Table of Contents

    Class VisualChunkMeshLayerConfigAsset

    Defines a ScriptableObject asset that configures the rendering and visual properties for a chunk mesh layer in a hex terrain system.

    Inheritance
    object
    Object
    ScriptableObject
    HexTerrainLayerConfigAsset<ChunkMeshLayer>
    ChunkMeshLayerConfigAsset
    VisualChunkMeshLayerConfigAsset
    CloudsChunkMeshLayerConfigAsset
    RainChunkMeshLayerConfigAsset
    RoadsChunkMeshLayerConfigAsset
    WaterChunkMeshLayerConfigAsset
    Implements
    ITerrainLayerFactory
    IVisualChunkMeshLayerConfig
    IChunkMeshLayerConfig
    Inherited Members
    ChunkMeshLayerConfigAsset._heightMapArgs
    ChunkMeshLayerConfigAsset.HeightMapArgs
    ChunkMeshLayerConfigAsset._transparencyMapArgs
    ChunkMeshLayerConfigAsset.TransparencyMapArgs
    ChunkMeshLayerConfigAsset._biomeMapArgs
    ChunkMeshLayerConfigAsset.BiomeMapArgs
    ChunkMeshLayerConfigAsset._isAutoPaintBiomes
    ChunkMeshLayerConfigAsset.IsAutoPaintBiomes
    ChunkMeshLayerConfigAsset._autoPaintBiomesLevels
    ChunkMeshLayerConfigAsset.AutoPaintBiomesLevels
    ChunkMeshLayerConfigAsset._autoPaintBiomesOffset
    ChunkMeshLayerConfigAsset.AutoPaintBiomesOffset
    ChunkMeshLayerConfigAsset._chunkMeshLayerSettings
    ChunkMeshLayerConfigAsset.ChunkMeshLayerSettings
    ChunkMeshLayerConfigAsset._syncHeightMapLayerReference
    ChunkMeshLayerConfigAsset.SyncHeightMapLayerReference
    ChunkMeshLayerConfigAsset._syncBiomeMapLayerReference
    ChunkMeshLayerConfigAsset.SyncBiomeMapLayerReference
    ChunkMeshLayerConfigAsset._syncTransparencyMapLayerReference
    ChunkMeshLayerConfigAsset.SyncTransparencyMapLayerReference
    HexTerrainLayerConfigAsset<ChunkMeshLayer>.CreateTerrainLayer<TTargetLayer>()
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Fwt.HexTerrains.ChunkMehes.Data
    Assembly: fwt.hexterrains.dll
    Syntax
    [CreateAssetMenu(fileName = "VisualChunkMeshLayerConfigAsset", menuName = "Fwt/HexTerrains/ChunkMeshes/VisualChunkMeshLayerConfigAsset")]
    public class VisualChunkMeshLayerConfigAsset : ChunkMeshLayerConfigAsset, ITerrainLayerFactory, IVisualChunkMeshLayerConfig, IChunkMeshLayerConfig
    Remarks

    This asset provides settings for controlling the visibility, rendering parameters, surface render configurations, and biome UV mappings for a visual chunk mesh layer. It is intended to be used within the Unity Editor to customize how terrain chunks are rendered, including support for multiple view modes and biome-specific UVs. The asset can be created via the Unity asset menu and is typically referenced by terrain generation or rendering systems.

    Fields

    _biomeUvs

    Declaration
    [Tooltip("UVs for the hex surface biomes. In standard case the UV index = biome index.\nUsed if IsUseBiomeAtlas is true.")]
    [SerializeField]
    protected List<Sprite> _biomeUvs
    Field Value
    Type Description
    List<Sprite>

    _defaultRenderConfig

    Declaration
    [Tooltip("If there is no render config for the view mode found, this config will be used as a fallback.")]
    [SerializeField]
    protected HexSurfaceRenderConfigAsset _defaultRenderConfig
    Field Value
    Type Description
    HexSurfaceRenderConfigAsset

    _isVisible

    Declaration
    [Tooltip("If true, the layer will be rendered.")]
    [SerializeField]
    protected bool _isVisible
    Field Value
    Type Description
    bool

    _renderConfigs

    Declaration
    [Tooltip("Render configurations for the surface layer. Used to get materials and params like IsCastShadows, IsReceive Shadows, etc.\nIndex of the config in this list corresponds to the view mode of the terrain.\nWhen the view mode == 0, the first config will be used, when view mode == 1, the second config will be used, etc.")]
    [SerializeField]
    protected List<HexSurfaceRenderConfigAsset> _renderConfigs
    Field Value
    Type Description
    List<HexSurfaceRenderConfigAsset>

    _renderSettings

    Declaration
    [Tooltip("Contains settings for rendering chunk meshes.")]
    [SerializeField]
    protected ChunkMeshRenderSettings _renderSettings
    Field Value
    Type Description
    ChunkMeshRenderSettings

    Properties

    BiomeUVConfigs

    Gets an enumerable collection of biome UV configuration objects for the chunk mesh.

    Declaration
    public IEnumerable<ChunkMeshBiomeUVConfig> BiomeUVConfigs { get; }
    Property Value
    Type Description
    IEnumerable<ChunkMeshBiomeUVConfig>

    BiomeUvs

    UVs for the hex surface biomes. In standard case the UV index = biome index. Used if IsUseBiomeAtlas is true.

    Declaration
    public List<Sprite> BiomeUvs { get; set; }
    Property Value
    Type Description
    List<Sprite>

    DefaultRenderConfig

    If there is no render config for the view mode found, this config will be used as a fallback.

    Declaration
    public HexSurfaceRenderConfigAsset DefaultRenderConfig { get; set; }
    Property Value
    Type Description
    HexSurfaceRenderConfigAsset

    IsVisible

    If true, the layer will be rendered.

    Declaration
    public bool IsVisible { get; set; }
    Property Value
    Type Description
    bool

    RenderConfigs

    Render configurations for the surface layer. Used to get materials and params like IsCastShadows, IsReceive Shadows, etc. Index of the config in this list corresponds to the view mode of the terrain. When the view mode == 0, the first config will be used, when view mode == 1, the second config will be used, etc.

    Declaration
    public List<HexSurfaceRenderConfigAsset> RenderConfigs { get; set; }
    Property Value
    Type Description
    List<HexSurfaceRenderConfigAsset>

    RenderSettings

    Contains settings for rendering chunk meshes.

    Declaration
    public ChunkMeshRenderSettings RenderSettings { get; set; }
    Property Value
    Type Description
    ChunkMeshRenderSettings

    Methods

    CreateTerrainLayer()

    Creates a terrain layer using the specified initialization arguments.

    Declaration
    public override HexTerrainLayer CreateTerrainLayer()
    Returns
    Type Description
    HexTerrainLayer

    created terrain layer

    Overrides
    ChunkMeshLayerConfigAsset.CreateTerrainLayer()

    ExtractUVFromSprite(Sprite, float4)

    Extracts the minimum and maximum UV coordinates from the specified sprite. Returns the provided fallback value if the sprite is null or does not contain valid UV data.

    Declaration
    public virtual float4 ExtractUVFromSprite(Sprite sprite, float4 fallback)
    Parameters
    Type Name Description
    Sprite sprite

    The sprite from which to extract UV coordinates. If null or if the sprite's UV array is invalid, the fallback value is returned.

    float4 fallback

    The value to return if the sprite is null or does not contain at least four UV coordinates.

    Returns
    Type Description
    float4

    A float4 containing the minimum (x, y) and maximum (z, w) UV coordinates of the sprite. Returns the fallback value if the sprite is null or its UV data is invalid.

    GetBiomeConfigs()

    Returns an enumerable collection of biome UV configuration objects for the current set of biome sprites.

    Declaration
    public virtual IEnumerable<ChunkMeshBiomeUVConfig> GetBiomeConfigs()
    Returns
    Type Description
    IEnumerable<ChunkMeshBiomeUVConfig>

    An enumerable collection of ChunkMeshBiomeUVConfig instances representing the UV configurations for each biome. If no biome sprites are defined, the collection contains a single default configuration.

    Remarks

    The returned collection will skip any null entries in the underlying biome sprite list. If the biome sprite list is null or empty, a default configuration with full UV coverage is returned.

    Implements

    ITerrainLayerFactory
    IVisualChunkMeshLayerConfig
    IChunkMeshLayerConfig

    Extension Methods

    Extensions_UnityObject.SmartDestroy<TObject>(TObject)
    Extensions_UnityObject.SmartDisableGameObject<TObject>(TObject)
    Extensions_UnityObject.SmartEnableGameObject<TObject>(TObject)
    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