void Start() { string path; string sound; switch (sesion.getMascota()) { case "Tigre_button": path = "Animaciones/Tigre/Tigre"; sound = "Musica/Animales/Tigre"; break; case "Elefante_button": path = "Animaciones/Elefante/Elefante"; sound = "Musica/Animales/Elefante"; break; case "Panda_button": path = "Animaciones/Panda/Panda"; sound = "Musica/Animales/Panda"; break; case "Rino_button": path = "Animaciones/Rino/Rino"; sound = "Musica/Animales/Rino"; break; case "Leopardo_button": path = "Animaciones/Leopardo/Leopardo"; sound = "Musica/Animales/Leopardo"; break; case "Polar_button": path = "Animaciones/Polar/Polar"; sound = "Musica/Animales/Polar"; break; default: path = "Animaciones/Tigre/Tigre"; sound = "Musica/Animales/Tigre"; break; } animator = gameObject.GetComponent <Animator>(); animator.runtimeAnimatorController = Resources.Load(path) as RuntimeAnimatorController; UnityEngine.UI.Button Sonido = GameObject.Find("Sonido").GetComponent <UnityEngine.UI.Button> (); AudioSource Audio = Sonido.GetComponent <AudioSource>(); Audio.clip = Resources.Load(sound) as AudioClip; }
void Start() { switch (sesion.getMascota()) { case "Tigre_button": path = "Animaciones/Reserva/Tigre_reserva"; sound = "Musica/Animales/Tigre"; break; case "Elefante_button": path = "Animaciones/Reserva/Elefante_reserva"; sound = "Musica/Animales/Elefante"; break; case "Panda_button": path = "Animaciones/Reserva/Panda_reserva"; sound = "Musica/Animales/Panda"; break; case "Rino_button": path = "Animaciones/Reserva/Rino_reserva"; sound = "Musica/Animales/Rino"; break; case "Leopardo_button": path = "Animaciones/Reserva/Leopardo_reserva"; sound = "Musica/Animales/Leopardo"; break; case "Polar_button": path = "Animaciones/Reserva/Polar_reserva"; sound = "Musica/Animales/Polar"; break; default: path = "Animaciones/Reserva/Tigre_reserva"; sound = "Musica/Animales/Tigre"; break; } animator = gameObject.GetComponent <Animator>(); animator.runtimeAnimatorController = Resources.Load(path) as RuntimeAnimatorController; }