Player Random audio and animation - Unity c #

0

Good morning. can someone help me I'm trying to do a random audio and synchronized animation but I'm not getting it. Any help is welcome.

  • I know how to do with string and image, less with animation

Script I made with String

[Header("MinhasMusicas")]

  //public AudioSource[] Track;
 [Header("AutorDaMusica")]

  //public string[] Meunome;
 [Header("TextovaiAqui")]

  //public Text Names;
  private int Sound;

  void ToqueMusica(int Numero)
  {
      Sound = Numero;
      Names.text = Meunome[Numero];
      Track[Numero].Play();
  }
  void Start(){ToqueMusica(Random.Range(0, Track.Length));}
  void Update()
  {
      if (!Track[Sound].isPlaying)
      {
          ToqueMusica(Random.Range(0, Track.Length));
      }
  }
}
    
asked by anonymous 15.03.2018 / 15:48

0 answers