Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class HeatMapVisual : MonoBehaviour
- {
- private Grid grid;
- private Mesh mesh;
- private void Awake()
- {
- mesh = new Mesh();
- GetComponent<MeshFilter>().mesh = mesh;
- UpdateHeatMapVisual();
- }
- public void SetGrid(Grid grid)
- {
- this.grid = grid;
- Debug.Log(this.grid);
- }
- private void UpdateHeatMapVisual()
- {
- Debug.Log(grid);
- MeshUtils.CreateEmptyMeshArrays(grid.GetWidth() * grid.GetHeight(), out Vector3[] vertices, out Vector2 [] uv, out int[] triangles);
- //cycle through width and height
- for (int x = 0; x < grid.GetWidth(); x++)
- {
- for (int y = 0; y < grid.GetHeight(); y++)
- {
- int index = x * grid.GetHeight() + y;
- Debug.Log(index);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement