start of work on miniMap generation

-base structure of Tile script
-object for tile prefab(without parametrs)
This commit is contained in:
ean205
2026-01-20 20:11:55 +03:00
parent e3f865116f
commit 67a5a9da47
2 changed files with 61 additions and 3 deletions

Binary file not shown.

View File

@@ -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<SpriteRenderer>().color = color;
}
}