Advertisement
Placido_GDD

HeatMapVisual

Mar 24th, 2022 (edited)
1,188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.94 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class HeatMapVisual : MonoBehaviour
  6. {
  7.     private Grid grid;
  8.     private Mesh mesh;
  9.  
  10.  
  11.     private void Awake()
  12.     {
  13.         mesh = new Mesh();
  14.         GetComponent<MeshFilter>().mesh = mesh;
  15.         UpdateHeatMapVisual();
  16.     }
  17.  
  18.     public void SetGrid(Grid grid)
  19.     {
  20.         this.grid = grid;
  21.         Debug.Log(this.grid);
  22.     }
  23.     private void UpdateHeatMapVisual()
  24.     {
  25.         Debug.Log(grid);
  26.         MeshUtils.CreateEmptyMeshArrays(grid.GetWidth() * grid.GetHeight(), out Vector3[] vertices, out Vector2 [] uv, out int[] triangles);
  27.         //cycle through width and height
  28.         for (int x = 0; x < grid.GetWidth(); x++)
  29.         {
  30.             for (int y = 0; y < grid.GetHeight(); y++)
  31.             {
  32.                 int index = x * grid.GetHeight() + y;
  33.                 Debug.Log(index);
  34.             }
  35.         }
  36.     }
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement