Что за ошибка такая?
MissingComponentException: There is no 'AudioSource' attached to the "menu_s" game object, but a script is trying to access it.
You probably need to add a AudioSource to the game object "menu_s". Or your script needs to check if the component is attached before using it.
menu_s.Start () (at Assets/scripts/menu_s.cs:11)
|
Вот код
[RequireComponent(typeof(AudioSource))]
public class menu_s : MonoBehaviour
{
public GameObject spritelogo;
public AudioClip menusound;
// Use this for initialization
IEnumerator Start ()
{
audio.Play();
yield return new WaitForSeconds(audio.clip.length);
audio.clip = menusound;
audio.Play();
}
// Update is called once per frame
void Update ()
{
}
}