using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
[ExecuteAlways]
public class CordinetLables : MonoBehaviour
{
TextMeshPro lable;
Vector2Int Coordinates = new Vector2Int();
void Awake()
{
lable = GetComponent<TextMeshPro>();
DisplayCoordinates();
}
// Update is called once per frame
void Update()
{
if (!Application.isPlaying)
{
DisplayCoordinates();
}
}
void DisplayCoordinates()
{
Coordinates.x = Mathf.RoundToInt(transform.position.x / UnityEditor.EditorSnapSettings.move.x);
Coordinates.y = Mathf.RoundToInt(transform.position.z / UnityEditor.EditorSnapSettings.move.z);
lable.text = Coordinates.x + "," + Coordinates.y;
}
}