u3d的外部加载视屏,采用www方式,可以使用gui播放,也可以绑定到gameobject上作为动态材质使用,不过目前只支持。ogg格式,需要转。。。

using UnityEngine;
using System.Collections; public class movie : MonoBehaviour
{
    private MovieTexture movTexture;     private string movPath;     void Start()
    {
        movPath = "file://" + Application.dataPath + "/1.ogg";
        StartCoroutine(LoadMoview());     }
    public void LoadRes()
    {
        movPath = "file://" + Application.dataPath + "/1.ogg";
        StartCoroutine(LoadMoview());
    }
    IEnumerator LoadMoview()
    {
        WWW wwwDate = new WWW(movPath);         yield return wwwDate;
        movTexture = wwwDate.movie;//得到下载的贴图
        movTexture.loop = true;
        movTexture.Play();
    }     // Update is called once per frame
    void Update()
    {
        // GUI.DrawTexture(new Rect(0 + 100, 0 + 100, Screen.width - 100, Screen.height - 100), movTexture, ScaleMode.ScaleToFit);
                 this.renderer.material.mainTexture = movTexture;  
    }     void OnGUI()
    {
     
       
    }
}

下面是给一个gameobject加上这个脚本

using UnityEngine;
using System.Collections; public class Init : MonoBehaviour
{
private GameObject m_ObjCube;
// Use this for initialization
void Start ()
{
m_ObjCube = GameObject.Find("ECube");
m_ObjCube.AddComponent<movie>();
//m_ObjCube.GetComponent<movie>().LoadRes();
} // Update is called once per frame
void Update () { }
}

u3d加载外部视屏的更多相关文章

  1. 【Win 10 应用开发】加载外部的 srt 字幕

    据说系统内置的多媒体功能支持 srt. ssa 等字幕,老周测试过几种格式的字幕均能加载. SRT 字幕是最简单的字幕结构,甚至你用记事本都能做出来,就是分为几行来写. 第一行是字幕的编号,应该是从1 ...

  2. 背水一战 Windows 10 (11) - 资源: CustomResource, ResourceDictionary, 加载外部的 ResourceDictionary 文件

    [源码下载] 背水一战 Windows 10 (11) - 资源: CustomResource, ResourceDictionary, 加载外部的 ResourceDictionary 文件 作者 ...

  3. JBoss 系列十四:JBoss7/WildFly如何加载外部的文件或properties文件

    http://www.tuicool.com/articles/M7ZR3y 原文 http://blog.csdn.net/kylinsoong/article/details/12623997 主 ...

  4. Error #2044: 未处理的 IOErrorEvent:。 text=Error #2035: 找不到 URL这是flash加载外部资源时有时会遇到的问题,对于此问题解决如下

    导致这个错误的主要原因是未添加IOErrorEvent事件监听,或者添加了监听,但是加载时使用了unload() 参考资料: http://blog.csdn.net/chjh0540237/arti ...

  5. js 鼠标滚动到某屏时,加载那一屏的数据,仿京东首页楼层异步加载模式

    js用处:在做商城时,首页图片太多,严重影响首页打开速度,所以我们需要用到异步加载楼层.js名称:鼠标滚动到某屏时,加载那一屏的数据,仿京东首页楼层模式js解释:1.用于商城的楼层内容异步加载,滚动条 ...

  6. FusionCharts简单教程(六)------加载外部Logo

    一.加载外部文件Logo       在使用FusionCharts时,我们可能需要在加载图像的时候需要在图表中显示标识.图片等等.这里我们可以使用logoURL属性来实现.如: <chart ...

  7. 资源: CustomResource, ResourceDictionary, 加载外部的 ResourceDictionary 文件

    CustomResource ResourceDictionary 加载外部的 ResourceDictionary 文件 示例1.演示“CustomResource”相关知识点Resource/Cu ...

  8. 使用js加载器动态加载外部Javascript文件

    原文:http://www.cnblogs.com/xdp-gacl/p/3927417.html 今天在网上找到了一个可以动态加载js文件的js加载器,具体代码如下: JsLoader.js var ...

  9. 转载:Flash AS3.0 加载外部资源(图片,MP3,SWF)的两种方式

    Flash AS3.0 加载外部资源(图片,MP3,SWF)的两种方式 出自:http://www.cnblogs.com/top5/archive/2012/08/04/2623464.html 关 ...

随机推荐

  1. Lintcode: Sort Colors II 解题报告

    Sort Colors II 原题链接: http://lintcode.com/zh-cn/problem/sort-colors-ii/# Given an array of n objects ...

  2. LeetCode: Maximum Subarray 解题报告

    Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which ...

  3. 【Python】京东商品价格监控

    import requests,json,re,winsound,time class Stock(object): def __init__(self): self.province_dict={v ...

  4. html页面去掉滚动条

    有时候特别需要,个别网页要去掉横向滚动条和竖向滚动条,那该怎么去掉呢,很简单,看代码: 让竖条没有: <body style=`overflow:-Scroll;overflow-y:hidde ...

  5. hdu3191+hdu1688(求最短路和次短路条数,模板)

    hdu3191题意:求出次短路的长度和条数 #include<iostream> #include<cstdio> #include<cstring> #inclu ...

  6. Android实例-获取屏幕的物理分辨率

    相关资料: http://blog.qdac.cc/?p=1161 实例代码: unit Unit1; interface uses System.SysUtils, System.Types, Sy ...

  7. /.well-known/apple-app-site-association

    Technical Q&A QA1919 Incoming requests for /.well-known/apple-app-site-association file Q:  Why ...

  8. kafka集群中jmx端口设置

    jmx端口主要用来监控kafka集群的. 在启动kafka的脚本kafka-server-start.sh中找到堆设置,添加export JMX_PORT="9999" if [ ...

  9. UI设计 - 首页(主页)的任务

    什么是首页 首页,又可以叫主页,是我们的网站或者APP的主要页面,它是我们接触的第一个页面(如果不包含闪屏页和登陆页的话). 特点 首页是一个开始的地方,我们开始真正接触网站提供给我们的内容. 首页是 ...

  10. buzhoutiao

    基于SUI前端框架 前台HTML: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " ...