private void HidePointer() { if (visible) { pointerHideStartTime = Time.time; } visible = false; if (isPointing) { //Stop looping sound loopingAudioSource.Stop(); PlayAudioClip(pointerAudioSource, pointerStopSound); } teleportPointerObject.SetActive(false); teleportArc.Hide(); foreach (TeleportPoint teleportMarker in teleportMarkers) { if (teleportMarker != null && teleportMarker.markerActive && teleportMarker.gameObject != null) { teleportMarker.gameObject.SetActive(false); } } destinationReticleTransform.gameObject.SetActive(false); invalidReticleTransform.gameObject.SetActive(false); SceneChaperone.Activate(false); isPointing = false; }
void ShowPlayArea(bool validLocation, Vector3 playerFeetOffset, Vector3 pointedAtPosition) { if (!validLocation) { SceneChaperone.Activate(false); return; } Vector3 offsetToUse = playerFeetOffset; //Adjust the actual offset to prevent the play area marker from moving too much if (!movedFeetFarEnough) { float distanceFromStartingOffset = Vector3.Distance(playerFeetOffset, startingFeetOffset); if (distanceFromStartingOffset < 0.1f) { offsetToUse = startingFeetOffset; } else if (distanceFromStartingOffset < 0.4f) { offsetToUse = Vector3.Lerp(startingFeetOffset, playerFeetOffset, (distanceFromStartingOffset - 0.1f) / 0.3f); } else { movedFeetFarEnough = true; } } SceneChaperone.SetTransform(pointedAtPosition + offsetToUse, Player.instance.transform.rotation); SceneChaperone.Activate(true); }