VanRtkDbg/Assets/Scripts/CellMap.cs

46 lines
903 B
C#
Raw Permalink Normal View History

2022-03-14 15:34:06 -07:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CellMap : MonoBehaviour
{
[System.Serializable]
public struct CellRow
{
public Cell[] cells;
}
public CellRow[] cellMapData;
public int column = 0;
public int row = 0;
// Start is called before the first frame update
void Start()
{
for (int y = 0; y < cellMapData.Length; y++)
{
for (int x = 0; x < cellMapData[y].cells.Length; x++)
{
cellMapData[y].cells[x].xPos = x;
cellMapData[y].cells[x].yPos = y;
}
}
row = cellMapData.Length;
column = cellMapData[0].cells.Length;
}
// Update is called once per frame
void Update()
{
}
public Cell GetCell(int x, int y)
{
return cellMapData[y].cells[x];
}
}