Welcome, guest! Login / Register - Why register?
[email protected] webmail now available. Want one? Go here.

Paste

Pasted as C# by Ondrej ( 1 year ago )
[SerializeField]
private AudioSource m_source = null;

[SerializeField]
private AudioClip[] m_clips = null;

private void Awake()
{
    m_graph = new AudioCrossfadeGraph();
    m_graph.Create(m_source, m_clips);
}

private void OnDestroy()
{
    m_graph.Destroy();
    m_graph = null;
}

private void Update()
{
    int clipIndex = 3;
    float fadeTime = 5.0f;
    m_graph.Crossfade(clipIndex, fadeTime);
}

 

Revise this Paste

Your Name: Code Language: