本文整理汇总了C#中MovieTexture.Play方法的典型用法代码示例。如果您正苦于以下问题:C# MovieTexture.Play方法的具体用法?C# MovieTexture.Play怎么用?C# MovieTexture.Play使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MovieTexture
的用法示例。
在下文中一共展示了MovieTexture.Play方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlayVideo
public IEnumerator PlayVideo()
{
GameObject.Find ("First Person Controller").GetComponent<Level10Health> ().guiEnabled = false;
cam.depth = 2;
GameObject.Find("Initialization").GetComponent<AudioSource>().audio.Stop();
GameObject.Find("Initialization").GetComponent<CursorTime>().showCursor = false;
GameObject.Find("Initialization").GetComponent<AudioSource>().volume = 1;
Screen.lockCursor = true;
//Screen.showCursor = false;
//GameObject.Find("Main Camera").GetComponent<MouseLook>().enabled = false;
//GameObject.Find("First Person Controller").GetComponent<MouseLook>().enabled = false;
movie = renderer.material.mainTexture as MovieTexture;
audio.clip = movie.audioClip;
audio.Play();
movie.Play();
yield return new WaitForSeconds(audio.clip.length);
movie.Stop();
cam.depth = -2;
audio.volume = 0;
movie.Play();
audio.Play();
yield return new WaitForSeconds(0.2F);
movie.Pause();
audio.Pause();
Screen.lockCursor = false;
GameObject.Find("Initialization").GetComponent<AudioSource>().audio.clip = scary;
audio.volume = 1;
GameObject.Find("Initialization").GetComponent<AudioSource>().audio.Play ();
GameObject.Find("Initialization").GetComponent<CursorTime>().showCursor = true;
GameObject.Find ("First Person Controller").GetComponent<Level10Health> ().guiEnabled = true;
//Application.LoadLevel(Application.loadedLevel);
}
示例2: playTreasureAnimation
public void playTreasureAnimation()
{
//show movie
this.enabled = true;
movie = this.GetComponent<RawImage>().mainTexture as MovieTexture;
movie.Play();
}
示例3: Start
void Start()
{
r = GetComponent<Renderer>();
movie = (MovieTexture)r.material.mainTexture;
movie.Play();
}
示例4: Start
// Use this for initialization
void Start()
{
transform.localScale = new Vector3(Camera.main.orthographicSize/2 * (Screen.width/Screen.height),Camera.main.orthographicSize/2,1f);
audioSource = GetComponent<AudioSource> ();
if (HammerController.gameOverState == 1) {
//success
GetComponent<MeshRenderer> ().materials [0].mainTexture = textures [0];
movTerxture = (MovieTexture)GetComponent<MeshRenderer> ().materials [0].mainTexture;
movTerxture.Play();
audioSource.clip = music1;
audioSource.Play();
audioSource.PlayOneShot(voiceovers[0]);
}
else if(HammerController.gameOverState == 2 )
{
GetComponent<MeshRenderer> ().materials [0].mainTexture = textures [1];
movTerxture = (MovieTexture)GetComponent<MeshRenderer> ().materials [0].mainTexture;
movTerxture.Play();
audioSource.clip = music2;
audioSource.Play();
audioSource.PlayOneShot(voiceovers[1]);
}
}
示例5: PlayMovieWWW
IEnumerator PlayMovieWWW(string url) {
WWW www = new WWW(url);
while(!www.movie.isReadyToPlay)
yield return www;
try {
if (www.error != null)
Debug.Log("WWW Error - " + www.error);
else {
movieTexture = www.movie;
Debug.Log("Movie is playing!");
movieAudioClip = movieTexture.audioClip;
movieAudioSource.clip = movieAudioClip;
mMovie.renderer.material.mainTexture = movieTexture;
movieTexture.Play();
movieAudioSource.Play();
}
}
catch(Exception ex){
Debug.Log("EarthRotator.DownloadFile(): Exception - " + ex.Message);
Exception innerEx = ex.InnerException;
while (innerEx != null) {
Debug.Log("EarthRotator.DownloadFile(): Inner Exception - " + innerEx.Message);
innerEx = innerEx.InnerException;
}
}
}
示例6: LoadMovie
IEnumerator LoadMovie(string url)
{
debugText.text += "\nLoading...";
WWW videoStream = new WWW (url);
sphereTexture = videoStream.movie;
GetComponent <AudioSource>().clip = videoStream.audioClip;
float startLoadTime = Time.timeSinceLevelLoad;
while (!sphereTexture.isReadyToPlay)
{
if (!string.IsNullOrEmpty(videoStream.error))
{
debugText.text += videoStream.error;
return false;
}
yield return 0;
}
debugText.text += "\nTime " + (Time.timeSinceLevelLoad - startLoadTime).ToString ();
debugText.text += "\nReady!";
GetComponent<Renderer> ().material.mainTexture = sphereTexture;
GetComponent<AudioSource> ().Play ();
sphereTexture.Play ();
sphereTexture.loop = true;
}
示例7: StartStream
protected IEnumerator StartStream()
{
//KEEP IT HERE
string sexVideo = "file://" + Application.streamingAssetsPath + "/Sex1.ogv";
string platonicVideo = "file://" + Application.streamingAssetsPath + "/Prude1.ogv";
string url;
if (isSexVideoPlaying)
{
url = sexVideo;
}
else
{
url = platonicVideo;
}
WWW videoStreamer = new WWW(url);
movieTexture = videoStreamer.movie;
GetComponent<AudioSource>().clip = movieTexture.audioClip;
while (!movieTexture.isReadyToPlay)
{
yield return 0;
}
GetComponent<AudioSource>().Play ();
movieTexture.Play ();
movieTexture.loop = true;
GetComponent<RawImage>().texture = movieTexture;
//GetComponent<Renderer>().material.mainTexture = movieTexture;
}
示例8: Awake
void Awake()
{
myRenderer = GetComponent<Renderer>();
myMovieTexture = (MovieTexture)myRenderer.material.mainTexture;
myMovieTexture.loop = IsMovieLoopable;
myMovieTexture.Play ();
}
示例9: Start
// Use this for initialization
void Start()
{
mtex = GetComponent<Renderer>().material.mainTexture as MovieTexture;
#if (!UNITY_EDITOR)
mtex.Play();
#endif
}
示例10: Start
// Use this for initialization
void Start()
{
movie = GetComponent<Renderer>().material.mainTexture as MovieTexture;
GetComponent<AudioSource>().clip = movie.audioClip;
GetComponent<AudioSource>().Play();
movie.Play();
}
示例11: DoSetVideo
IEnumerator DoSetVideo(MovieTexture texture)
{
//We need the video to play before we can get his size
while (!texture.isPlaying)
{
texture.Play();
yield return null;
}
texture.Stop();
movie = texture;
movie.loop = true;
var videoObject = GetComponentInChildren<VideoObject>();
videoObject.SetVideo(texture);
playButton = GetComponentInChildren<Image>();
var collider = GetComponent<BoxCollider2D>();
var ratioX = (float)texture.width / texture.height;
var ratioY = (float)texture.height / texture.width;
if (ratioX > 1)
{
var size = new Vector2(RectTransform.sizeDelta.x * ratioX, RectTransform.sizeDelta.y);
RectTransform.sizeDelta = size;
collider.size = size;
}
else
{
var size = new Vector2(RectTransform.sizeDelta.x, RectTransform.sizeDelta.y * ratioY);
RectTransform.sizeDelta = size;
collider.size = size;
}
}
示例12: Start
// Use this for initialization
void Start () {
resize_window_plane ();
mov = (MovieTexture)renderer.material.mainTexture;
mov.Play ();
audio.Play();
StartCoroutine(checkMovieEnds());
}
示例13: Start
// Use this for initialization
void Start()
{
text = ((MovieTexture)GetComponent<Renderer>().material.mainTexture);
aud = GetComponent<AudioSource>();
aud.clip = text.audioClip;
text.Play();
aud.Play();
}
示例14: Start
// Use this for initialization
void Start()
{
//movTerxture = (MovieTexture)GetComponent<Renderer>().material.mainTexture;
RawImage rim = GetComponent<RawImage>();
movTerxture = (MovieTexture)rim.mainTexture;
movTerxture.Play();
}
示例15: playVideo
public void playVideo(MovieTexture texture)
{
this.movie = texture;
this.gameObject.SetActive(true);
GetComponent<RawImage>().texture = movie as MovieTexture;
movie.Stop();
movie.Play();
}