Created
March 21, 2015 05:06
-
-
Save OutlawGameTools/e34e5a26a3f05693af1c to your computer and use it in GitHub Desktop.
CS109 - Starts an AudioSource playing when attached object collider2D is triggered.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma strict | |
private var aSource : AudioSource; | |
function Start () | |
{ | |
aSource = GetComponent.<AudioSource>(); | |
} | |
function OnTriggerEnter2D () | |
{ | |
if (!aSource.isPlaying) | |
aSource.Play(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment