Examples of DamageSoundComponent


Examples of org.terasology.logic.health.DamageSoundComponent

    }

    @ReceiveEvent
    public void onDamaged(OnDamagedEvent event, EntityRef entity, CharacterSoundComponent characterSounds) {
        if (characterSounds.lastSoundTime + MIN_TIME < time.getGameTimeInMs()) {
            DamageSoundComponent damageSounds = event.getType().getComponent(DamageSoundComponent.class);
            StaticSound sound = null;
            if (damageSounds != null && !damageSounds.sounds.isEmpty()) {
                sound = random.nextItem(damageSounds.sounds);
            } else if (!characterSounds.damageSounds.isEmpty()) {
                sound = random.nextItem(characterSounds.damageSounds);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.