/// <summary> /// 通知Hud /// </summary> private void MessageToHudCrosShairSize() { Camera cam = CameraManager.GetInstance()?.GetMainCamereComponent()?.GetCamera(); if (cam != null) { MsgPlayerWeaponCrosshair_ShotGun crosshair = new MsgPlayerWeaponCrosshair_ShotGun(); float horFOV = cam.fieldOfView * cam.aspect; float verFOV = cam.fieldOfView; crosshair.SubAimAreaRelativeHeight.Clear(); crosshair.SubAimAreaScreenPosition.Clear(); for (int i = 0; i < m_AimAreaList.Count; i++) { AimArea aimArea = m_AimAreaList[i]; if (aimArea.IsSon) { //子区域 crosshair.SubAimAreaRelativeHeight.Add(new Vector2(aimArea.GetCoverAngle() / horFOV, aimArea.GetCoverAngle() / verFOV)); crosshair.SubAimAreaScreenPosition.Add(cam.WorldToScreenPoint(cam.transform.position + aimArea.GetCentralRay())); } } crosshair.RemainingRestoreDuration = Mathf.Clamp(m_TimeOfStartFire + m_RestoreDuration - Time.time, 0, float.MaxValue); GameFacade.Instance.SendNotification(NotificationName.PlayerWeaponCrosshairScale_ShotGun, crosshair); } }