// Use this for initialization void Start() { if (playerTargetingCam == null) { playerTargetingCam = GameObject.Find("vcam_playerTargeting").GetComponent <Cinemachine.CinemachineVirtualCamera>(); } InteractionButton.HoldEvent += StartTargeting; reticle = FindObjectOfType <PlayerThrowReticle>(); }
IEnumerator Targeting() { targeting = true; while (InteractionButton.pointerDown) { if (!PlayerPickup.HoldingGuest) { Debug.LogWarning("Targeting broken"); targeting = false; throwing = false; reticle.ToggleVisuals(false, Vector3.zero); playerTargetingCam.Priority = -10; targetingRoutine = null; yield break; } yield return(null); } ThrowGuestAtTarget(PlayerThrowReticle.GetReticlePosition()); targetingRoutine = null; yield return(null); }