Where I'm at Drawing
Week 11 'Where I'm At' drawing for studio 3.
I solved last weeks problem, with a bit of help from my Dad who has more experience in C# and the world of programing than I.
Turns out my hunch about the commad of making the click sound was halfway right. It was failing due to the submit command being executed before it could play.
Code now looks like this;
public void ClickSound()
{
//Debug.Log("ClickSound was pressed");
soundEFX.PlayOneShot(clickEFX);
StartCoroutine(WaitForSound());
}
private IEnumerator WaitForSound()
{
//Wait Until Sound has finished playing
while (soundEFX.isPlaying)
{
yield return null;
}
var MainMenu = GameObject.Find("MainMenu_Panel");
//Auidio has finished playing, disable GameObject
MainMenu.SetActive(false);
}
By Maeskye Trigg
Email Maeskye Trigg
Published On: 22/05/2019
AGI Studio 3, C#, Game, MTrigg, Major Work, s3490713, sketch