本文整理汇总了C#中MovieTexture类的典型用法代码示例。如果您正苦于以下问题:C# MovieTexture类的具体用法?C# MovieTexture怎么用?C# MovieTexture使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MovieTexture类属于命名空间,在下文中一共展示了MovieTexture类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Awake
void Awake()
{
r = GetComponent<Renderer>();
_movie = (MovieTexture)r.material.mainTexture;
_audio = GetComponent<AudioSource>();
_audio.clip = _movie.audioClip;
}
示例2: playTreasureAnimation
public void playTreasureAnimation()
{
//show movie
this.enabled = true;
movie = this.GetComponent<RawImage>().mainTexture as MovieTexture;
movie.Play();
}
示例3: 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);
}
示例4: Start
// Use this for initialization
void Start()
{
mtex = GetComponent<Renderer>().material.mainTexture as MovieTexture;
#if (!UNITY_EDITOR)
mtex.Play();
#endif
}
示例5: Start
/* ----------------------------------------
* At Start, set up movie texture and audio clip,
* playing the video if required.
*/
void Start()
{
// Assign AudioSource component to 'audio' variable
audio = GetComponent<AudioSource> ();
if (!video)
// IF there is no Movie Texure assigned to 'video', THEN use the Movie Texture assigned to the material's main texture
video = GetComponent<Renderer>().material.mainTexture as MovieTexture;
if (!audioClip)
// IF there is no Audio Clip assigned to 'audioClip', THEN use the audio clip assigned to object's Audio Source component
audioClip = audio.clip;
video.Stop ();
audio.Stop ();
// Assign 'loop' boolean value to Movie Texture's 'Loop' option
video.loop = loop;
// Assign 'loop' boolean value to Audio Source 'Loop' option
audio.loop = loop;
if(playFromStart)
// IF 'playFromStart' is selected, THEN call ControlMovie function
ControlMovie();
}
示例6: Logic
IEnumerator Logic(MovieTexture movie)
{
yield return new WaitForSeconds (movie.duration);
//Application.LoadLevel(Application.loadedLevel+1);
GameManager.instance.current_state = GameManager.GameStates.MAIN;
GameManager.instance.scene_loaded = false;
}
示例7: Start
void Start()
{
r = GetComponent<Renderer>();
movie = (MovieTexture)r.material.mainTexture;
movie.Play();
}
示例8: Start
// Use this for initialization
void Start () {
resize_window_plane ();
mov = (MovieTexture)renderer.material.mainTexture;
mov.Play ();
audio.Play();
StartCoroutine(checkMovieEnds());
}
示例9: 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;
}
}
示例10: 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]);
}
}
示例11: Awake
void Awake()
{
myRenderer = GetComponent<Renderer>();
myMovieTexture = (MovieTexture)myRenderer.material.mainTexture;
myMovieTexture.loop = IsMovieLoopable;
myMovieTexture.Play ();
}
示例12: Start
// Use this for initialization
void Start()
{
movie = GetComponent<Renderer>().material.mainTexture as MovieTexture;
GetComponent<AudioSource>().clip = movie.audioClip;
GetComponent<AudioSource>().Play();
movie.Play();
}
示例13: Start
void Start()
{
StartCoroutine(showVideo());
movie = (MovieTexture)renderer.material.mainTexture;
audio = GetComponent<AudioSource>();
audio.clip = movie.audioClip;
}
开发者ID:victorffernandes,项目名称:SBGames_2003_FabieliHelena_NicoleAlves_VictorFernandes,代码行数:7,代码来源:VideoController.cs
示例14: playMovie
public void playMovie(){
if(!mov){
resize_window_plane ();
mov = (MovieTexture)renderer.material.mainTexture;
}
mov.Play ();
audio.Play ();
}
示例15: Awake
void Awake()
{
rend = GetComponent<Renderer>();
mTexture = (MovieTexture)rend.material.mainTexture;
videoDuration = mTexture.duration;
audioSrc = GetComponent<AudioSource>();
audioSrc.clip = mTexture.audioClip;
}