From 67a5a9da47b9a288f9de06860d5d134968512deb Mon Sep 17 00:00:00 2001 From: ean205 Date: Tue, 20 Jan 2026 20:11:55 +0300 Subject: [PATCH] start of work on miniMap generation -base structure of Tile script -object for tile prefab(without parametrs) --- Assets/Scenes/Game.unity | 4 +-- Assets/scripts/miniMap/Tile.cs | 60 +++++++++++++++++++++++++++++++++- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/Assets/Scenes/Game.unity b/Assets/Scenes/Game.unity index 0186a90..38d2652 100644 --- a/Assets/Scenes/Game.unity +++ b/Assets/Scenes/Game.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:45ce29d7c715ed438e0e5591c8b6514f58a8d4f48992a140314c52ec494d48bb -size 245596 +oid sha256:d57ea5a4f10403c6bd348259fe65d60a7866b61feb3d93a67accdeac28c2ffaa +size 252162 diff --git a/Assets/scripts/miniMap/Tile.cs b/Assets/scripts/miniMap/Tile.cs index 874a143..7087601 100644 --- a/Assets/scripts/miniMap/Tile.cs +++ b/Assets/scripts/miniMap/Tile.cs @@ -4,15 +4,73 @@ 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; + } }