mirror of
https://github.com/DerTyp7/grow-ai-unity.git
synced 2025-11-02 06:02:30 +01:00
Grid
This commit is contained in:
25
Assets/Scripts/Grid/TestGrid.cs
Normal file
25
Assets/Scripts/Grid/TestGrid.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TestGrid : MonoBehaviour
|
||||
{
|
||||
Grid grid;
|
||||
void Start()
|
||||
{
|
||||
grid = new Grid(100, 100, 1, new Vector3(0, 0));
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
grid.SetValue(Camera.main.ScreenToWorldPoint(Input.mousePosition), 44);
|
||||
}
|
||||
|
||||
if (Input.GetMouseButtonDown(1))
|
||||
{
|
||||
Debug.Log(grid.GetValue(Camera.main.ScreenToWorldPoint(Input.mousePosition)));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user