LevelData
This commit is contained in:
@@ -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)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user