Advertisement
Placido_GDD

GridTesting

Mar 24th, 2022
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using CodeMonkey.Utils;
  5. public class GridTest : MonoBehaviour
  6. {
  7. private Grid grid;
  8. [SerializeField] private HeatMapVisual heatMapVisual;
  9. private void Start()
  10. {
  11. grid = new Grid(20,10,10.0f,Vector3.zero);
  12. heatMapVisual.SetGrid(grid);
  13. }
  14.  
  15. private void Update()
  16. {
  17. if (Input.GetMouseButtonDown(0))
  18. {
  19. Vector3 position = UtilsClass.GetMouseWorldPosition();
  20. int value = grid.GetValue(position);
  21. grid.SetValue(position, value + 5);
  22. }
  23. }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement