Skip to content
Snippets Groups Projects
BiomeData.cs 1.19 KiB
Newer Older
Ryan Chang's avatar
Ryan Chang committed
using System;
using System.Collections.Generic;
using UnityEngine;
Ryan Chang's avatar
Ryan Chang committed
using NaughtyAttributes;
Ryan Chang's avatar
Ryan Chang committed

/// <summary>
/// Contains the actual data that will be used to dictate the biome.
/// </summary>
Ryan Chang's avatar
Ryan Chang committed
[Serializable]
Ryan Chang's avatar
Ryan Chang committed
public class BiomeData
{
Ryan Chang's avatar
Ryan Chang committed
    #region Variables
    [Header("User settings")]
    [Tooltip("List curves that pertain to each specific biome parameter.")]
    public ParameterTargets parameterTargets;

    [Tooltip("What is used to generate the terrain.")]
Ryan Chang's avatar
Ryan Chang committed
    public List<Octave> shapeGenerate;
Ryan Chang's avatar
Ryan Chang committed

    [Tooltip("What is used to map terrain materials to heights.")]
    public List<TerrainHeightMap> terrainMap;
    #endregion

    /// <summary>
    /// Reseeds the map and shapeMap octaves by randomizing their
    /// offsets.
    /// </summary>
    public void ReseedOctaves()
    {
Ryan Chang's avatar
Ryan Chang committed
        shapeGenerate = shapeGenerate.ReseedOctaves();
Ryan Chang's avatar
Ryan Chang committed
    }

    /// <summary>
    /// Reset the parameter targets.
    /// </summary>
    /// <param name="targets"></param>
    public void ResetParamTargets(List<BiomeParameter> targets)
    {
        parameterTargets = new(targets);
    }
}

[Serializable]
public struct TerrainHeightMap
{
    public float minHeight;
    public float maxHeight;

    public Texture texture;
Ryan Chang's avatar
Ryan Chang committed
}