コード例 #1
0
ファイル: F3DWeaponAudio.cs プロジェクト: sebasrobert/baston
 // Reload
 public void OnReload(WeaponAudioInfo audioInfo)
 {
     WeaponReload.outputAudioMixerGroup = audioInfo.ReloadMixerGroup;
     audioInfo.ReloadLastUniqiueIndex   =
         F3DAudio.GetUniqueRandomClipIndex(audioInfo.Reload.Length, audioInfo.ReloadLastUniqiueIndex);
     F3DAudio.PlayOneShotRandom(WeaponReload, audioInfo.Reload[audioInfo.ReloadLastUniqiueIndex],
                                audioInfo.ReloadVolume, audioInfo.ReloadPitch);
 }
コード例 #2
0
    // Land
    public void OnLand()
    {
        var state        = CharacterState.Land;
        var surfaceClips = GetSurfaceClips(state);

        _lastFootstepsLandIndex = F3DAudio.GetUniqueRandomClipIndex(surfaceClips.Length, _lastFootstepsLandIndex);
        F3DAudio.PlayOneShotRandom(FootstepsLand, surfaceClips[_lastFootstepsLandIndex], GetSurfaceVolume(state),
                                   GetSurfacePitch(state));
    }
コード例 #3
0
    // Animation EVENT: Crouch
    public void OnCrouchMoveAnimation()
    {
        var state        = CharacterState.Crouch;
        var surfaceClips = GetSurfaceClips(state);

        _lastFootstepsCrouchIndex =
            F3DAudio.GetUniqueRandomClipIndex(surfaceClips.Length, _lastFootstepsCrouchIndex);
        F3DAudio.PlayOneShotRandom(Footsteps, surfaceClips[_lastFootstepsCrouchIndex], GetSurfaceVolume(state),
                                   GetSurfacePitch(state));
    }
コード例 #4
0
    // Double Jump
    public void OnDoubleJump()
    {
        OnJump();
        var state        = CharacterState.DoubleJump;
        var surfaceClips = GetSurfaceClips(state);

        _lastFootstepsDoubleJumpIndex =
            F3DAudio.GetUniqueRandomClipIndex(surfaceClips.Length, _lastFootstepsDoubleJumpIndex);
        F3DAudio.PlayOneShotRandom(FootstepsJump, surfaceClips[_lastFootstepsDoubleJumpIndex], GetSurfaceVolume(state),
                                   GetSurfacePitch(state));
    }
コード例 #5
0
ファイル: F3DWeaponAudio.cs プロジェクト: sebasrobert/baston
    // WEAPON

    // Fire single round
    public void OnFire(WeaponAudioInfo audioInfo)
    {
        if (audioInfo.Shot == null || audioInfo.Shot.Length < 1)
        {
            return;
        }
        Weapon.outputAudioMixerGroup   = audioInfo.MixerGroup;
        audioInfo.ShotLastUniqiueIndex =
            F3DAudio.GetUniqueRandomClipIndex(audioInfo.Shot.Length, audioInfo.ShotLastUniqiueIndex);
        F3DAudio.PlayOneShotRandom(Weapon, audioInfo.Shot[audioInfo.ShotLastUniqiueIndex],
                                   audioInfo.ShotVolume, audioInfo.ShotPitch);
    }
コード例 #6
0
    // Jump
    public void OnJump()
    {
        var state        = CharacterState.Jump;
        var surfaceClips = GetSurfaceClips(state);

        _lastFootstepsJumpIndex = F3DAudio.GetUniqueRandomClipIndex(surfaceClips.Length, _lastFootstepsJumpIndex);
        F3DAudio.PlayOneShotRandom(FootstepsJump, surfaceClips[_lastFootstepsJumpIndex], GetSurfaceVolume(state),
                                   GetSurfacePitch(state));

//        // Grunt
//        if (Voice == null || VoiceClipsGrunt == null || VoiceClipsGrunt.Length <= 0) return;
//        _lastVoiceGruntIndex = GetUniqueRandomClipIndex(VoiceClipsGrunt.Length, -1); // -1 cancels out the unique index
//        Voice.Stop();
//        PlayOneShotRandom(Voice, VoiceClipsGrunt[_lastVoiceGruntIndex], VoiceVolumeRandom, VoicePitchRandom);
    }