bool IsSprinting() { bool isSprinting = Input.GetKey(KeyCode.LeftShift); bool isFiring = activeWeapon.IsFiring(); bool isReloading = reloadWeapon.isReloading; bool isChangingWeapon = activeWeapon.isChangingWeapon; bool isAiming = characterAiming.isAiming; return(isSprinting && !isFiring && !isReloading && !isChangingWeapon && !isAiming); }
//int count = 0; bool IsSprinting() { //bool isSprinting = Input.GetKey(KeyCode.LeftShift); bool isSprinting = mobileSprintingButtonPressed; //if (mobileSprintingButtonPressed != false && count == 0) { Debug.Log(mobileSprintingButtonPressed); count = 1; } //if (mobileSprintingButtonPressed == false && count == 1) { Debug.Log(mobileSprintingButtonPressed); count = 0; } bool isFiring = activeWeapon.IsFiring(); bool isReloading = reloadWeapon.isReloading; bool isChangingWeapon = activeWeapon.isChangingWeapon; bool isAiming = characterAiming.isAiming; return(isSprinting && !isFiring && !isReloading && !isChangingWeapon && !isAiming); }