// 정조준 로직 가동 private void FineSight() { isFineSightMode = !isFineSightMode; currentGun.anim.SetBool("FineSightMode", isFineSightMode); //총을 가운데로 모아주는 애니메이션 실행 theCrosshair.FineSightAnimation(isFineSightMode); //정조준시 크로스헤어 제거 애니메이션 실행 if (isFineSightMode) { StopAllCoroutines(); StartCoroutine(FineSightActivateCoroutine()); } else { StopAllCoroutines(); StartCoroutine(FineSightDeactivateCoroutine()); } }
private void FineSight() { isFineSightMode = !isFineSightMode; currentGun.anim.SetBool("FineSightMode", isFineSightMode); theCrosshair.FineSightAnimation(isFineSightMode); if (isFineSightMode) { StopAllCoroutines(); StartCoroutine(FineSightActivateCoroutine()); } else { StopAllCoroutines(); StartCoroutine(FineSightDeactivateCoroutine()); } }
// 정조준 로직 가동 private void FineSight() // 처음에 False이므로 true로 바꿔준다. true로 바뀌면서 애니메이션 실행 { isfineSightMode = !isfineSightMode; currentGun.anim.SetBool("FineSightMode", isfineSightMode); theCrosshair.FineSightAnimation(isfineSightMode); if (isfineSightMode) { StopAllCoroutines(); // Nerp는 멈추지 않고 계속 실행되면서 보간하기 때문에 밑에서 2개가 같이 실행되버림 StartCoroutine(FineSightActivateCoroutine()); } else { StopAllCoroutines(); // 그렇기 때문에 기존에 실행되던 코루틴을 멈추기 위해 Stop한것임 StartCoroutine(FineSightDeActivateCoroutine()); } }