Please be advised that the Audiokinetic offices will close at 3:00 p.m. EST on December 23rd, 2019 for the holiday period, and will reopen on January 3rd, 2020 at 9:00 a.m. EST. Learn more.

Lesson 8

Table of Contents

Setting a Music Region State: SetMusicState

(go to Setting a Music Region State)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SetMusicState : MonoBehaviour {
    public AK.Wwise.State OnTriggerEnterState;
    public AK.Wwise.State OnTriggerExitState;
    private void OnTriggerEnter(Collider other){
        if(other.CompareTag("Player")){
            OnTriggerEnterState.SetValue();
        }
    }
    private void OnTriggerExit(Collider other){
        if(other.CompareTag("Player")){
            OnTriggerExitState.SetValue();
        }
    }
}