src/core/WeaponSystem.js
/**
	* Updates weapon changing logic.
	*
	* @return {WeaponSystem} A reference to this weapon system.
	*/
Updates weapon changing logic.
@return {WeaponSystem} A reference to this weapon system.
Updates weapon changing logic . @return { WeaponSystem } A reference to this weapon system .
updateWeaponChange() {
		if ( this.nextWeaponType !== null ) {
			if ( this.currentWeapon.status === WEAPON_STATUS_READY ||
					this.currentWeapon.status === WEAPON_STATUS_EMPTY ||
					this.currentWeapon.status === WEAPON_STATUS_OUT_OF_AMMO ) {
				this.currentWeapon.hide();
			}
			if ( this.currentWeapon.status === WEAPON_STATUS_UNREADY ) {
				this.changeWeapon( this.nextWeaponType );
				this.currentWeapon.equip();
				this.nextWeaponType = null;
			}
		}
		return this;
	}
updateWeaponChange ( ) { if ( this . nextWeaponType !== null ) { if ( this . currentWeapon . status === WEAPON_STATUS_READY || this . currentWeapon . status === WEAPON_STATUS_EMPTY || this . currentWeapon . status === WEAPON_STATUS_OUT_OF_AMMO ) { this . currentWeapon . hide ( ) ; } if ( this . currentWeapon . status === WEAPON_STATUS_UNREADY ) { this . changeWeapon ( this . nextWeaponType ) ; this . currentWeapon . equip ( ) ; this . nextWeaponType = null ; } } return this ; }
Updates weapon changing logic.
Updates weapon changing logic .
// if the current weapon is in certain states, hide it in order to start the weapon change // as soon as the current weapon becomes unready, change to the defined next weapon type