public void SetSwimming(bool value, float ySpeed = 0.0f) { swimming = value; if (swimming == true) { timer = 1000; weaponManager.SelectWeapon(0); enteredWater = false; water_height = this.transform.position.y; swimSlowGravity = ySpeed / 18; PlayRandomSound(enterWaterSounds); } else { queued = false; underwater = false; enteredWater = false; PlayRandomSound(exitWaterSounds); } SetAnimState("swimming", swimming); moveController.enabled = !swimming; weaponManager.canEquipWeapons = !swimming; headBobScript.enabled = !swimming; this.enabled = swimming; }
public void InitClimbing() { if (enableWhenClimbing != null) { foreach (GameObject targetObj in enableWhenClimbing) { targetObj.SetActive(true); } } if (disableWhenClimbing != null) { foreach (GameObject targetObj in disableWhenClimbing) { targetObj.SetActive(false); } } current = GetClosestClimbPoint(); if (current != null) { climbSpeed = initClimbSpeed; AssignInitialIKTarget(current.GetComponent <ClimbPoint>()); AssignMovePoints(this.transform, current.transform); SetCameraRotationPoints(true, current.transform); StartCoroutine(EnableClimbing()); moveController.enabled = false; swimController.enabled = false; SetClimbAnimation(true); enableIK = true; weaponManager.canEquipWeapons = false; weaponManager.SelectWeapon(0); } }