Beispiel #1
0
    void Awake()
    {
        TH_Audio.Init();

        for (int i = 0; i < 16; i++)
        {
            SetChannelVoice(i, voiceData.ChannelVoices[i]);
        }
    }
    public void UpdateMonsterState(MonsterAudioUpdate update)
    {
        TH_Audio.SetChannelVolume(0, 0.05f);
        TH_Audio.SetChannelVolume(1, 0.05f * update.PlayerSeesMonster);
        TH_Audio.SetChannelVolume(2, 0.05f * update.MonsterSeesPlayer);
        TH_Audio.SetChannelVolume(3, 0.03f * update.Proximity);
        TH_Audio.SetChannelVolume(9, 0.2f * update.Proximity);

        layeredMusic.SetBPM(140 + (update.Proximity * 600));
    }
    private void Start()
    {
        layeredMusic = new TH_Audio.MIDISound("Assets\\MIDI\\LayeredBGM.mid");
        layeredMusic.Play(true);

        for (MIDISfx i = 0; i < MIDISfx.COUNT; i++)
        {
            soundLibrary[i] = new TH_Audio.MIDISound("Assets\\MIDI\\SFX\\" + i.ToString() + ".mid");
        }

        TH_Audio.SetChannelVolume(0, 0);
        TH_Audio.SetChannelVolume(1, 0);
        TH_Audio.SetChannelVolume(2, 0);
        TH_Audio.SetChannelVolume(3, 0);
        TH_Audio.SetChannelVolume(9, 0);

        TH_Audio.SetMasterVolume(1);
    }
Beispiel #4
0
    // Update is called once per frame
    void Update()
    {
        if (movement.IsAtDestination())
        {
            TH_Audio.SetChannelVolume(11, 0);
            soundMIDI.SetBPM(180);
        }
        else
        {
            TH_Audio.SetChannelVolume(11, 0.2f);

            // Increase rate based on how fast we are moving compared to slowest speed
            stepTimer += (UnityEngine.Time.deltaTime * (movement.GetAgentSpeed() / movement.walkingSpeed));
            if (stepTimer > (timeBetweenSteps))
            {
                stepTimer = 0;

                particles.Play();
                PlaySound();
            }
        }
    }
Beispiel #5
0
 void OnDestroy()
 {
     TH_Audio.Shutdown();
 }