Thursday, 26 April 2012

Unity Codes

Trigger code


function OnTriggerEnter()
{
audio.Play();
}

function OnTriggerExit()
{
audio.Stop();
}



Interactive code



function OnMouseDown()
{
audio.Play();
}

function OnMouseUp()
{
audio.Stop();
}



Collision code


function OnCollisionEnter()
{
audio.Play();
}

No comments:

Post a Comment