예제 #1
0
    private void Aiming()
    {
        if (Input.GetButtonDown("Fire2") && !isReload) // 마우스 오른쪽키가 눌렸을때
        {
            isAiming = !isAiming;
            theGun.anim.SetBool("Aiming", isAiming);

            if (isAiming)
            {
                theCrosshair.AimingAnimation(isAiming);
                StopAllCoroutines(); // 모든 코루틴 멈춤
                StartCoroutine(AimingCorutine());
            }
            else
            {
                theCrosshair.AimingAnimation(isAiming);
                StopAllCoroutines();
                StartCoroutine(NormalCorutine());
            }
        }
    }