Example #1
0
 private void SelectNewDestinationCell()
 {
     m_DestCell = GetDestinationCell();
     m_Navigator.SetDestination(new destination(GetDestinationCellPosition(), DestType.Explore, ExploreDestPrecision, user_data: m_DestCell, stop: false));
     // force reevaluation so connectivity check is performed on selected cell (it is cheaper than checking connectivity for all unexplored cells)
     m_ValidateDestCell = true;
 }
Example #2
0
        public void OnDestinationReached(DestType type, Vec3 dest)
        {
            if (type != DestType.Explore)
            {
                return;
            }

            ExploreCell dest_cell = m_ExploreCells.FirstOrDefault(x => x.Position.Equals(dest));

            if (dest_cell != null)
            {
                OnCellExplored(dest_cell);
            }

            m_DestCell = GetDestinationCell();
            m_Navigator.SetDestination(GetDestinationCellPosition(), DestType.Explore, ExploreDestPrecision);
        }
Example #3
0
        private void SelectNewDestinationCell(ExploreCell curr_explore_cell)
        {
            //using (new Profiler("SelectNewDestinationCell [%t]"))
            {
                var prev_dest_cell = m_DestCell;
                m_DestCell = GetDestinationCell(curr_explore_cell);

                //Trace.WriteLine($"dest explore cell id {m_DestCell?.GlobalId ?? -1} pos {GetDestinationCellPosition()}");

                //using (new Profiler("set explore cell pos as dest [%t]"))
                if (Enabled)
                {
                    m_Navigator.SetDestination(new destination(GetDestinationCellPosition(), DestType.Explore, ExploreDestPrecision, user_data: m_DestCell, stop: false));
                }

                // force reevaluation so connectivity check is performed on selected cell (it is cheaper than checking connectivity for all unexplored cells)
                m_ValidateDestCell = m_DestCell != prev_dest_cell;
            }
        }