LevelData

This commit is contained in:
2023-06-16 09:51:16 +03:00
parent 36f90ddd64
commit d9fbd99072
7 changed files with 100 additions and 15 deletions

View File

@@ -25,8 +25,8 @@ namespace Objects
public void Move(Vector2Int direction)
{
LayoutCell currentCell = LevelBuilder.Instance.GetCellAt(layoutPosition);
LayoutCell targetCell = LevelBuilder.Instance.GetCellAt(layoutPosition + direction);
LayoutCell currentCell = LevelBuilder.Instance.GetCellAtLayout(layoutPosition);
LayoutCell targetCell = LevelBuilder.Instance.GetCellAtLayout(layoutPosition + direction);
if (targetCell != null && targetCell.IsFree)
{

View File

@@ -68,7 +68,7 @@ namespace Objects
public void Teleport(LayoutCell targetCell)
{
LayoutCell currentCell = LevelBuilder.Instance.GetCellAt(layoutPosition);
LayoutCell currentCell = LevelBuilder.Instance.GetCellAtLayout(layoutPosition);
// Free previous cell
currentCell.cellData.cellContent = LayoutCell.LayoutCellData.CellContent.None;
@@ -86,8 +86,8 @@ namespace Objects
public void Move(Vector2Int direction)
{
LayoutCell currentCell = LevelBuilder.Instance.GetCellAt(layoutPosition);
LayoutCell targetCell = LevelBuilder.Instance.GetCellAt(layoutPosition + direction);
LayoutCell currentCell = LevelBuilder.Instance.GetCellAtLayout(layoutPosition);
LayoutCell targetCell = LevelBuilder.Instance.GetCellAtLayout(layoutPosition + direction);
if (targetCell != null && targetCell.IsFree)
{
@@ -114,7 +114,7 @@ namespace Objects
private void OnLevelInitialized()
{
gameObject.SetActive(true);
Teleport(LevelBuilder.Instance.GetCellAt(new Vector2Int(0, 0)));
Teleport(LevelBuilder.Instance.GetCellAtLayout(new Vector2Int(0, 0)));
}