36 lines
929 B
C#
36 lines
929 B
C#
using System.Collections;
|
|
using GISTech.GISTerrainLoader;
|
|
using UnityEngine;
|
|
|
|
public class UpdateTextures : MonoBehaviour
|
|
{
|
|
public TextureMode texturemode;
|
|
|
|
public KeyCode UpdateKey;
|
|
|
|
public GISTerrainContainer container;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (Input.GetKeyDown(UpdateKey))
|
|
{
|
|
StartCoroutine(UpdateRasterData());
|
|
}
|
|
}
|
|
|
|
public IEnumerator UpdateRasterData()
|
|
{
|
|
GISTerrainLoaderPrefs gISTerrainLoaderPrefs = new GISTerrainLoaderPrefs();
|
|
gISTerrainLoaderPrefs.LoadSettings();
|
|
gISTerrainLoaderPrefs.TerrainFilePath = Application.streamingAssetsPath + "/GIS Terrains/UTM-NAD83/Tiff.tif";
|
|
gISTerrainLoaderPrefs.textureMode = texturemode;
|
|
gISTerrainLoaderPrefs.TerrainShaderType = ShaderType.ColorRamp;
|
|
gISTerrainLoaderPrefs.UnderWaterShader = OptionEnabDisab.Disable;
|
|
yield return StartCoroutine(container.GenerateTextures(gISTerrainLoaderPrefs, ClearLayers: true));
|
|
}
|
|
}
|