Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
{SUPER MEMBER}-LV.4
{SUPER MEMBER}-LV.4
Posts : 60
Points : 1624
Rep : 3
Join date : 2014-04-29
Location : Algeria
View user profile

Playing Audio script?

on Sun Jun 08, 2014 8:18 am
Help me guys i need a script that replays a .mwv or mp3 audio file but waits a few seconds before the replay. Does any body knows how to make that possible?  Question 
Member [Lv. 3]
Member [Lv. 3]
Posts : 37
Points : 1642
Rep : 19
Join date : 2014-06-14
View user profile

Re: Playing Audio script?

on Wed Aug 13, 2014 2:07 pm
Try the following C# code:
using UnityEngine;
using System.Collections;

public class Audio : MonoBehaviour {

// Use this for initialization
void Start () {
StartCoroutine (PlayAudio ());

}

IEnumerator PlayAudio(){
while(true){
yield return new WaitForSeconds (3f);
audio.Play ();
}
}
}
Back to top
Permissions in this forum:
You cannot reply to topics in this forum