void Update() { // Read the jump input in Update so button presses aren't missed. #if CROSS_PLATFORM_INPUT if (CrossPlatformInput.GetButtonDown("Jump")) { jump = true; } #else if (Input.GetButtonDown("Jump")) { jump = true; } #endif if (Input.GetButtonDown("E")) { int currentWeapon = player.playerStats.CurrentEquippedWeaponIndex; int weaponsSize = player.playerStats.Weapons.Count; if (weaponsSize == 0) { return; } if (currentWeapon < weaponsSize - 1) { character.EquipWeapon(currentWeapon + 1); } else { character.EquipWeapon(0); } } if (Input.GetButtonDown("Q")) { int currentWeapon = player.playerStats.CurrentEquippedWeaponIndex; int weaponsSize = player.playerStats.Weapons.Count; if (weaponsSize == 0) { return; } if (currentWeapon > 0) { character.EquipWeapon(currentWeapon - 1); } else { character.EquipWeapon(weaponsSize - 1); } } //if right mouse click if (Input.GetButtonDown("Fire2")) { ThrowGrenade(); } }