299 lines
5.6 KiB
C#
299 lines
5.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[Serializable]
|
|
public class terrain_class2
|
|
{
|
|
public bool active;
|
|
|
|
public bool foldout;
|
|
|
|
public int index;
|
|
|
|
public int index_old;
|
|
|
|
public bool on_row;
|
|
|
|
public Color color_terrain;
|
|
|
|
public Component rtp_script;
|
|
|
|
public Texture2D[] splat_alpha;
|
|
|
|
public Terrain terrain;
|
|
|
|
public Transform parent;
|
|
|
|
public string name;
|
|
|
|
public area_class prearea;
|
|
|
|
public float[,,] map;
|
|
|
|
public List<splatPrototype_class> splatPrototypes;
|
|
|
|
public splatPrototype_class colormap;
|
|
|
|
public bool splats_foldout;
|
|
|
|
public List<treePrototype_class> treePrototypes;
|
|
|
|
public bool trees_foldout;
|
|
|
|
public List<detailPrototype_class> detailPrototypes;
|
|
|
|
public bool details_foldout;
|
|
|
|
public List<TreeInstance> tree_instances;
|
|
|
|
public float[] splat;
|
|
|
|
public float[] splat_calc;
|
|
|
|
public float[] color;
|
|
|
|
public float[] splat_layer;
|
|
|
|
public float[] color_layer;
|
|
|
|
public float[] grass;
|
|
|
|
public int heightmap_resolution_list;
|
|
|
|
public int splatmap_resolution_list;
|
|
|
|
public int basemap_resolution_list;
|
|
|
|
public int detailmap_resolution_list;
|
|
|
|
public int detail_resolution_per_patch_list;
|
|
|
|
public Vector3 size;
|
|
|
|
public bool size_xz_link;
|
|
|
|
public int tile_x;
|
|
|
|
public int tile_z;
|
|
|
|
public Vector2 tiles;
|
|
|
|
public Rect rect;
|
|
|
|
public bool data_foldout;
|
|
|
|
public Vector3 scale;
|
|
|
|
public bool maps_foldout;
|
|
|
|
public bool settings_foldout;
|
|
|
|
public bool resolution_foldout;
|
|
|
|
public bool scripts_foldout;
|
|
|
|
public bool reset_foldout;
|
|
|
|
public bool size_foldout;
|
|
|
|
public int raw_file_index;
|
|
|
|
public raw_file_class raw_save_file;
|
|
|
|
public int heightmap_resolution;
|
|
|
|
public int splatmap_resolution;
|
|
|
|
public int detail_resolution;
|
|
|
|
public int detail_resolution_per_patch;
|
|
|
|
public int basemap_resolution;
|
|
|
|
public bool size_synchronous;
|
|
|
|
public bool resolutions_synchronous;
|
|
|
|
public bool splat_synchronous;
|
|
|
|
public bool tree_synchronous;
|
|
|
|
public bool detail_synchronous;
|
|
|
|
public Vector2 splatmap_conversion;
|
|
|
|
public Vector2 heightmap_conversion;
|
|
|
|
public Vector2 detailmap_conversion;
|
|
|
|
public bool splat_foldout;
|
|
|
|
public int splat_length;
|
|
|
|
public int color_length;
|
|
|
|
public bool tree_foldout;
|
|
|
|
public int tree_length;
|
|
|
|
public bool detail_foldout;
|
|
|
|
public float detail_scale;
|
|
|
|
public bool base_terrain_foldout;
|
|
|
|
public bool tree_detail_objects_foldout;
|
|
|
|
public bool wind_settings_foldout;
|
|
|
|
public bool settings_all_terrain;
|
|
|
|
public float heightmapPixelError;
|
|
|
|
public int heightmapMaximumLOD;
|
|
|
|
public bool castShadows;
|
|
|
|
public float basemapDistance;
|
|
|
|
public float treeDistance;
|
|
|
|
public float detailObjectDistance;
|
|
|
|
public float detailObjectDensity;
|
|
|
|
public int treeMaximumFullLODCount;
|
|
|
|
public float treeBillboardDistance;
|
|
|
|
public float treeCrossFadeLength;
|
|
|
|
public bool draw;
|
|
|
|
public bool editor_draw;
|
|
|
|
public TerrainDetail script_terrainDetail;
|
|
|
|
public bool settings_runtime;
|
|
|
|
public bool settings_editor;
|
|
|
|
public float wavingGrassSpeed;
|
|
|
|
public float wavingGrassAmount;
|
|
|
|
public float wavingGrassStrength;
|
|
|
|
public Color wavingGrassTint;
|
|
|
|
public neighbor_class neighbor;
|
|
|
|
public terrain_class2()
|
|
{
|
|
active = true;
|
|
color_terrain = new Color(2f, 2f, 2f, 1f);
|
|
prearea = new area_class();
|
|
splatPrototypes = new List<splatPrototype_class>();
|
|
colormap = new splatPrototype_class();
|
|
treePrototypes = new List<treePrototype_class>();
|
|
detailPrototypes = new List<detailPrototype_class>();
|
|
tree_instances = new List<TreeInstance>();
|
|
heightmap_resolution_list = 5;
|
|
splatmap_resolution_list = 4;
|
|
basemap_resolution_list = 4;
|
|
size = new Vector3(1000f, 250f, 1000f);
|
|
size_xz_link = true;
|
|
tiles = new Vector2(1f, 1f);
|
|
data_foldout = true;
|
|
resolution_foldout = true;
|
|
raw_file_index = -1;
|
|
raw_save_file = new raw_file_class();
|
|
heightmap_resolution = 129;
|
|
splatmap_resolution = 128;
|
|
detail_resolution = 128;
|
|
detail_resolution_per_patch = 8;
|
|
basemap_resolution = 128;
|
|
size_synchronous = true;
|
|
resolutions_synchronous = true;
|
|
splat_synchronous = true;
|
|
tree_synchronous = true;
|
|
detail_synchronous = true;
|
|
detail_scale = 1f;
|
|
base_terrain_foldout = true;
|
|
tree_detail_objects_foldout = true;
|
|
wind_settings_foldout = true;
|
|
settings_all_terrain = true;
|
|
heightmapPixelError = 5f;
|
|
basemapDistance = 20000f;
|
|
treeDistance = 20000f;
|
|
detailObjectDistance = 250f;
|
|
detailObjectDensity = 1f;
|
|
treeMaximumFullLODCount = 50;
|
|
treeBillboardDistance = 250f;
|
|
treeCrossFadeLength = 200f;
|
|
draw = true;
|
|
editor_draw = true;
|
|
settings_editor = true;
|
|
wavingGrassSpeed = 0.5f;
|
|
wavingGrassAmount = 0.5f;
|
|
wavingGrassStrength = 0.5f;
|
|
wavingGrassTint = new Color(0.698f, 0.6f, 0.5f);
|
|
neighbor = new neighbor_class();
|
|
}
|
|
|
|
public virtual void add_splatprototype(int splat_number)
|
|
{
|
|
splatPrototypes.Insert(splat_number, new splatPrototype_class());
|
|
}
|
|
|
|
public virtual void erase_splatprototype(int splat_number)
|
|
{
|
|
if (splatPrototypes.Count > 0)
|
|
{
|
|
splatPrototypes.RemoveAt(splat_number);
|
|
}
|
|
}
|
|
|
|
public virtual void clear_splatprototype()
|
|
{
|
|
splatPrototypes.Clear();
|
|
}
|
|
|
|
public virtual void add_treeprototype(int tree_number)
|
|
{
|
|
treePrototypes.Insert(tree_number, new treePrototype_class());
|
|
}
|
|
|
|
public virtual void erase_treeprototype(int tree_number)
|
|
{
|
|
if (treePrototypes.Count > 0)
|
|
{
|
|
treePrototypes.RemoveAt(tree_number);
|
|
}
|
|
}
|
|
|
|
public virtual void clear_treeprototype()
|
|
{
|
|
treePrototypes.Clear();
|
|
}
|
|
|
|
public virtual void add_detailprototype(int detail_number)
|
|
{
|
|
detailPrototypes.Insert(detail_number, new detailPrototype_class());
|
|
}
|
|
|
|
public virtual void erase_detailprototype(int detail_number)
|
|
{
|
|
if (detailPrototypes.Count > 0)
|
|
{
|
|
detailPrototypes.RemoveAt(detail_number);
|
|
}
|
|
}
|
|
|
|
public virtual void clear_detailprototype()
|
|
{
|
|
detailPrototypes.Clear();
|
|
}
|
|
}
|