Esempio n. 1
0
    public override void execute()
    {
        ComponentOwner obj = mReceiver as ComponentOwner;
        MovableObjectComponentAudio component = obj.getComponent(out component);

        component.setActive(true);
        string soundName = mSound != SOUND_DEFINE.SD_MAX ? mAudioManager.getAudioName(mSound) : mSoundFileName;

        if (mUseVolumeCoe)
        {
            mVolume *= mAudioManager.getVolumeScale(mSound);
        }
        component.play(soundName, mLoop, mVolume);
    }
Esempio n. 2
0
    public override void execute()
    {
        MovableObject movableObject = mReceiver as MovableObject;
        MovableObjectComponentAudio audioComponent = movableObject.getFirstActiveComponent <MovableObjectComponentAudio>();

        if (audioComponent != null)
        {
            string soundName = mSound != SOUND_DEFINE.SD_MAX ? mAudioManager.getAudioName(mSound) : mSoundFileName;
            if (mUseVolumeCoe)
            {
                mVolume *= mAudioManager.getVolumeScale(mSound);
            }
            audioComponent.play(soundName, mLoop, mVolume);
        }
    }