mirror of
https://github.com/DerTyp7/grow-ai-unity.git
synced 2025-10-30 04:47:10 +01:00
added Gridinfo
This commit is contained in:
@@ -15,9 +15,9 @@ public class GridBuildingSystem : MonoBehaviour
|
||||
if (instance == null)
|
||||
instance = this;
|
||||
|
||||
int gridWidth = 20;
|
||||
int gridHeight = 20;
|
||||
float cellSize = 1f;
|
||||
int gridWidth = GridInfo.instance.gridWidth;
|
||||
int gridHeight = GridInfo.instance.gridHeight;
|
||||
float cellSize = GridInfo.instance.cellSize;
|
||||
|
||||
buildingGrid = new Grid<GridObject>(gridWidth, gridHeight, cellSize, Vector3.zero, (Grid<GridObject> g, int x, int y) => new GridObject(g, x, y));
|
||||
placedObjectTypeSO = placedObjectTypeSOList[0];
|
||||
|
||||
@@ -1,16 +1,4 @@
|
||||
/*
|
||||
------------------- Code Monkey -------------------
|
||||
|
||||
Thank you for downloading this package
|
||||
I hope you find it useful in your projects
|
||||
If you have any questions let me know
|
||||
Cheers!
|
||||
|
||||
unitycodemonkey.com
|
||||
--------------------------------------------------
|
||||
*/
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ public class Pathfinding {
|
||||
private List<PathNode> openList;
|
||||
private List<PathNode> closedList;
|
||||
|
||||
public Pathfinding(int width, int height) {
|
||||
public Pathfinding(int width, int height, float cellSize) {
|
||||
Instance = this;
|
||||
grid = new Grid<PathNode>(width, height, 1f, Vector3.zero, (Grid<PathNode> g, int x, int y) => new PathNode(g, x, y));
|
||||
grid = new Grid<PathNode>(width, height, cellSize, Vector3.zero, (Grid<PathNode> g, int x, int y) => new PathNode(g, x, y));
|
||||
}
|
||||
|
||||
public Grid<PathNode> GetGrid() {
|
||||
|
||||
Reference in New Issue
Block a user