private void DrawGizmo() { MainCameraComponent mainCam = CameraManager.GetInstance().GetMainCamereComponent(); if (mainCam == null) { return; } // 根据当前瞄准方向更新主区域的目标信息 m_MainAimArea.UpdateBaseRay(GetViewRay().direction); Vector3 baseRayPos = mainCam.GetPosition() + m_MainAimArea.GetBaseRay(); GizmosHelper.GetInstance().DrawCircle(baseRayPos, 0.05f); m_MainAimArea.UpdateRayList(false); m_MainAimArea.GetRayList(ref m_AimDirectionsCache); for (int iRay = 0; iRay < m_AimDirectionsCache.Count; iRay++) { Vector3 pos = mainCam.GetPosition() + m_AimDirectionsCache[iRay]; GizmosHelper.GetInstance().DrawCircle(pos, 0.005f); GizmosHelper.GetInstance().DrawLine(mainCam.GetPosition(), mainCam.GetPosition() + m_AimDirectionsCache[iRay] * 5); } // 根据当前瞄准方向更新主区域的目标信息 for (int iAim = 0; iAim < m_SubAimAreas.Count; iAim++) { m_SubAimAreas[iAim].UpdateBaseRay(GetViewRay().direction); baseRayPos = mainCam.GetPosition() + m_SubAimAreas[iAim].GetBaseRay(); GizmosHelper.GetInstance().DrawCircle(baseRayPos, 0.05f); m_SubAimAreas[iAim].UpdateRayList(false); m_SubAimAreas[iAim].GetRayList(ref m_AimDirectionsCache); for (int iRay = 0; iRay < m_AimDirectionsCache.Count; iRay++) { Vector3 pos = mainCam.GetPosition() + m_AimDirectionsCache[iRay]; GizmosHelper.GetInstance().DrawCircle(pos, 0.005f); GizmosHelper.GetInstance().DrawLine(mainCam.GetPosition(), mainCam.GetPosition() + m_AimDirectionsCache[iRay] * 5); } } }