Selecciona tu lenguaje de programación favorito. Todos los fragmentos de código serán mostrados en este lenguaje.
Gracias por ayudarnos a mejorar la calidad de la documentación de Unity. A pesar de que no podemos aceptar todas las sugerencias, leemos cada cambio propuesto por nuestros usuarios y actualizaremos los que sean aplicables.
CerrarPor alguna razón su cambio sugerido no pudo ser enviado. Por favor <a>intente nuevamente</a> en unos minutos. Gracias por tomarse un tiempo para ayudarnos a mejorar la calidad de la documentación de Unity.
CerrarReturns a MovieTexture generated from the downloaded data (Read Only).
The data must be a movie in Ogg Theora format.
Even if the movie is not yet completely downloaded, this returns immediately,
allowing you to start playing the partial movie as it downloads.
See Also: MovieTexture.audioClip.
var url = "http://www.unity3d.com/webplayers/Movie/sample.ogg";
function Start () { // Start download var www = new WWW(url);
// Make sure the movie is ready to start before we start playing var movieTexture = www.movie; while (!movieTexture.isReadyToPlay) yield;
var gt = GetComponent.<GUITexture>();
// Initialize gui texture to be 1:1 resolution centered on screen gt.texture = movieTexture;
transform.localScale = Vector3 (0,0,0); transform.position = Vector3 (0.5,0.5,0); gt.pixelInset.xMin = -movieTexture.width / 2; gt.pixelInset.xMax = movieTexture.width / 2; gt.pixelInset.yMin = -movieTexture.height / 2; gt.pixelInset.yMax = movieTexture.height / 2;
// Assign clip to audio source // Sync playback with audio var aud = GetComponent.<AudioSource>(); aud.clip = movieTexture.audioClip;
// Play both movie & sound movieTexture.Play(); aud.Play(); } // Make sure we have gui texture and audio source @script RequireComponent (GUITexture) @script RequireComponent (AudioSource)