现在我有了以下简单的脚本来在平面上播放Movietexture。我希望能够检测到最后一帧,以便在另一个Text组件中触发倒计时脚本。我需要做些什么改变?统一 - 在MovieTexture中检测视频的最后一帧
using UnityEngine;
using System.Collections;
[RequireComponent (typeof (AudioSource))]
public class VideController : MonoBehaviour {
// Use this for initialization
void Start() {
Screen.SetResolution (768, 1024, false, 60);
MovieTexture movie = renderer.material.mainTexture as MovieTexture;
audio.clip = movie.audioClip;
audio.Play();
movie.Play();
}
// Update is called once per frame
void Update() {
}
}
快速谷歌产生了这些解决方案:HTTP:// forum.unity3d.com/threads/on-movie-end-switch-levels.47929/ http://answers.unity3d.com/questions/202303/on-movie-end.html – Imapler 2014-09-23 05:57:18