void OnSwipe(SwipeGesture gesture) { searchType = SearchPathType.SwipeToWalk; swipeIndexList.Clear(); swipeIndexListRaw.Clear(); foreach (Vector2 item in gesture.VectorsInProgress) { Vector3 bgPos = CameraHelper.ScreenPosToBackgroundPos(item); int index = m_pathGrid.GetCellIndexClamped(bgPos); if (m_pathGrid.IsBlocked(index)) { continue; } if (swipeIndexListRaw.Count == 0) { swipeIndexListRaw.Add(index); continue; } if (swipeIndexListRaw[swipeIndexListRaw.Count - 1] != index) { swipeIndexListRaw.Add(index); } } swipeIndexList = m_pathGrid.CornerIndexs(swipeIndexListRaw); swipeIndexListIndex = 0; m_navigationAgent.MoveToIndex(swipeIndexList.ToArray()); }