src/core/WeaponSystem.js
/**
	* Ensures that the current equiped weapon is rendered.
	*
	* @return {WeaponSystem} A reference to this weapon system.
	*/
Ensures that the current equiped weapon is rendered.
@return {WeaponSystem} A reference to this weapon system.
Ensures that the current equiped weapon is rendered . @return { WeaponSystem } A reference to this weapon system .
showCurrentWeapon() {
		const type = this.currentWeapon.type;
		switch ( type ) {
			case WEAPON_TYPES_BLASTER:
				this.renderComponents.blaster.mesh.visible = true;
				break;
			case WEAPON_TYPES_SHOTGUN:
				this.renderComponents.shotgun.mesh.visible = true;
				break;
			case WEAPON_TYPES_ASSAULT_RIFLE:
				this.renderComponents.assaultRifle.mesh.visible = true;
				break;
			default:
				console.error( 'DIVE.WeaponSystem: Invalid weapon type:', type );
				break;
		}
		return this;
	}
showCurrentWeapon ( ) { const type = this . currentWeapon . type ; switch ( type ) { case WEAPON_TYPES_BLASTER : this . renderComponents . blaster . mesh . visible = true ; break ; case WEAPON_TYPES_SHOTGUN : this . renderComponents . shotgun . mesh . visible = true ; break ; case WEAPON_TYPES_ASSAULT_RIFLE : this . renderComponents . assaultRifle . mesh . visible = true ; break ; default : console . error ( 'DIVE.WeaponSystem: Invalid weapon type:' , type ) ; break ; } return this ; }
Ensures that the current equiped weapon is rendered.
Ensures that the current equiped weapon is rendered .