Example #1
0
        private void SnapToGrid()
        {
            int gridSize = _waypoint.GetGridSize();

            transform.position = new Vector3(
                _waypoint.GetGridPos().x *gridSize,
                0f,
                _waypoint.GetGridPos().y *gridSize
                );
        }
Example #2
0
        protected void ExploreNeighbours()
        {
            if (!isRunning)
            {
                return;
            }

            foreach (Vector2Int direction in directions)
            {
                Vector2Int neighbourCoordinates = searchCenter.GetGridPos() + direction;
                if (grid.ContainsKey(neighbourCoordinates))
                {
                    AddNewNeighbours(neighbourCoordinates);
                }
            }
        }