using System.Collections; using System.Collections.Generic; using UnityEngine; public class Tile : MonoBehaviour { public enum landscapeTypes { water, lowGround, midGround, highGround, mountain, uncrosableMountain }; public enum stateTypes { idle, occupied }; public Vector2Int position; public float noiseValue; public Hex.landscapeTypes mapType; public stateTypes state = stateTypes.idle; //TODO переменная для памати содержимого // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void InitializeTile(Vector2Int pos, float noiseVal) { noiseValue = noiseVal; position = pos; //Debug.Log(noiseValue); noiseValue = Mathf.Pow(noiseValue, 1.7f); //Урезчение переходов ландшафта //Вынести эти велечины в настройки float waterLevel = 0.34f; float landLevel = 0.4f; float hillLevel = 0.6f; float highHillLevel = 0.75f; float mountainLevel = 0.95f; InitializeTexture(); } private void InitializeTexture() { Color color = new Color(0, 0, 0, 0); float pow = 1.2f; //степень в которую возводтится шум для дополнительного урезчения цветов' float val = Mathf.Pow(noiseValue, pow); GetComponent().color = color; } }