How to play news in TV when i switch on, using scr

2019-03-07 05:40发布

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条回答
该账号已被封号
2楼-- · 2019-03-07 06:04

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.

enter image description here

查看更多
登录 后发表回答