private void UpdateFlashlightParent(PlayerLook.View cameraView) { this.flashlightTransform.SetParent((cameraView == PlayerLook.View.FirstPerson) ? this.firstPersonCameraHolder : this.thirdPersonCameraHolder); this.flashlightTransform.localRotation = Quaternion.Euler(Vector3.zero); this.flashlightTransform.localPosition = Vector3.zero; }
private void OnViewChanged(PlayerLook.View newView) { this.UpdateFlashlightParent(newView); this.flashlightAnimator.SetBool(this.visibilityParamName, this.currentVisibility); if (this.flashlightAnimator.isActiveAndEnabled) { this.flashlightAnimator.Play(((this.currentVisibility) ? "On" : "Off") + "Idle"); } }