How to play news in TV when i switch on, using scripting language in Unity3D? [closed]

时间秒杀一切 提交于 2019-12-20 07:55:25

问题


I am new in unity3D. I need to know how can we play news in TV when i switch on using the scripting languages in Unity3D


回答1:


You might be interested in MovieTexture.

Movie Textures are animated Textures that are created from a video file. By placing a video file in your project's Assets Folder, you can import the video to be used exactly as you would use a regular Texture.

Video files are imported via Apple QuickTime. Supported file types are what your QuickTime installation can play (usually .mov, .mpg, .mpeg, .mp4, .avi, .asf). On Windows movie importing requires Quicktime to be installed.

if (Input.GetButtonDown ("Jump")) {
    if (renderer.material.mainTexture.isPlaying) {
        renderer.material.mainTexture.Pause();
    }
    else {
        renderer.material.mainTexture.Play();
    }
}

Note: This is a Pro/Advanced feature only.



来源:https://stackoverflow.com/questions/22292577/how-to-play-news-in-tv-when-i-switch-on-using-scripting-language-in-unity3d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!