IEnumerator StepUpdate() { while (Application.isPlaying) { if (CrossPlatformInputManager.GetButtonDown("Fire1") && Reticle.Is == Reticle.ReticleType.grab) { GRAB?.Invoke(); yield return(new WaitForSeconds(0.2f)); } if (CrossPlatformInputManager.GetButton("Fire1") && Reticle.Is == Reticle.ReticleType.shoot) { FIRE?.Invoke(); } if (CrossPlatformInputManager.GetButtonDown("Inventory") && m_fpc.IsGrounded()) { INVENTORY?.Invoke(); m_inInventory = !m_inInventory; ToggleCursor(m_inInventory); m_fpc.enabled = !m_inInventory; m_cam.enabled = !m_inInventory; } if (CrossPlatformInputManager.GetButtonDown("Flashlight") && WeaponManager.HasFlashlight) { WeaponManager.current.ToggleFlashlight(); } yield return(null); } }
void GrabLadder(bool grab, Rigidbody rb) { if (!grab) { _grab = GRAB.GRAB_OFF; isOnLadder = false; Physics.gravity = new Vector3(0, -20, 0); return; } else { _grab = GRAB.GRAB_MOVE; isOnLadder = true; Physics.gravity = new Vector3(0, 0, 0); rb.velocity = new Vector3(0, 0, 0); } }