src/weapons/AssaultRifle.js
/**
	* Inits animations for this weapon. Only used for the player.
	*
	* @return {AssaultRifle} A reference to this weapon.
	*/
Inits animations for this weapon. Only used for the player.
@return {AssaultRifle} A reference to this weapon.
Inits animations for this weapon . Only used for the player . @return { AssaultRifle } A reference to this weapon .
initAnimations() {
		const assetManager = this.owner.world.assetManager;
		const mixer = new AnimationMixer( this );
		const animations = new Map();
		const shotClip = assetManager.animations.get( 'assaultRifle_shot' );
		const reloadClip = assetManager.animations.get( 'assaultRifle_reload' );
		const hideClip = assetManager.animations.get( 'assaultRifle_hide' );
		const equipClip = assetManager.animations.get( 'assaultRifle_equip' );
		const shotAction = mixer.clipAction( shotClip );
		shotAction.loop = LoopOnce;
		const reloadAction = mixer.clipAction( reloadClip );
		reloadAction.loop = LoopOnce;
		const hideAction = mixer.clipAction( hideClip );
		hideAction.loop = LoopOnce;
		hideAction.clampWhenFinished = true;
		const equipAction = mixer.clipAction( equipClip );
		equipAction.loop = LoopOnce;
		animations.set( 'shot', shotAction );
		animations.set( 'reload', reloadAction );
		animations.set( 'hide', hideAction );
		animations.set( 'equip', equipAction );
		this.animations = animations;
		this.mixer = mixer;
		return this;
	}
initAnimations ( ) { const assetManager = this . owner . world . assetManager ; const mixer = new AnimationMixer ( this ) ; const animations = new Map ( ) ; const shotClip = assetManager . animations . get ( 'assaultRifle_shot' ) ; const reloadClip = assetManager . animations . get ( 'assaultRifle_reload' ) ; const hideClip = assetManager . animations . get ( 'assaultRifle_hide' ) ; const equipClip = assetManager . animations . get ( 'assaultRifle_equip' ) ; const shotAction = mixer . clipAction ( shotClip ) ; shotAction . loop = LoopOnce ; const reloadAction = mixer . clipAction ( reloadClip ) ; reloadAction . loop = LoopOnce ; const hideAction = mixer . clipAction ( hideClip ) ; hideAction . loop = LoopOnce ; hideAction . clampWhenFinished = true ; const equipAction = mixer . clipAction ( equipClip ) ; equipAction . loop = LoopOnce ; animations . set ( 'shot' , shotAction ) ; animations . set ( 'reload' , reloadAction ) ; animations . set ( 'hide' , hideAction ) ; animations . set ( 'equip' , equipAction ) ; this . animations = animations ; this . mixer = mixer ; return this ; }
Inits animations for this weapon.
Inits animations for this weapon .