private void detectWayPoint() { WayPoint curWayPoint = m_wayPointManager.GetWayPoint(transform.position); if (curWayPoint != null) { if (m_curWayPoint != null) { m_curWayPoint.RemoveTarget(m_wayPointFlag, transform); } m_curWayPoint = curWayPoint; m_curWayPoint.AddTarget(m_wayPointFlag, transform); } else { if (m_curWayPoint != null) { m_curWayPoint.RemoveTarget(m_wayPointFlag, transform); } m_curWayPoint = null; } }