当我打开电视时,如何使用Unity3D中的脚本语言在电视中播放新闻? [英] How to play news in TV when i switch on, using scripting language in Unity3D?

查看:448
本文介绍了当我打开电视时,如何使用Unity3D中的脚本语言在电视中播放新闻?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是unity3D的新手.我需要知道在Unity3D中使用脚本语言打开电视后如何在电视中播放新闻

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

推荐答案

您可能对MovieTexture感兴趣.

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.

视频文件是通过Apple QuickTime导入的.支持的文件类型是QuickTime安装可以播放的文件类型(通常是.mov,.mpg,.mpeg,.mp4,.avi,.asf).在Windows上,电影导入需要安装Quicktime.

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();
    }
}

注意:这仅是Pro/Advanced功能.

Note: This is a Pro/Advanced feature only.

这篇关于当我打开电视时,如何使用Unity3D中的脚本语言在电视中播放新闻?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆