zoukankan      html  css  js  c++  java
  • WebGL报错 uncaught referenceerror unitymodule is not defined

    本来是好好的,我只是想修改一下UnityProgress.js这个脚本来改一下加载webGl的时候的Unity元素为自定义,或者起码不显示吧。

    function UnityProgress(unityInstance, progress) {
    if (!unityInstance.Module)
    return;
    if (!unityInstance.logo) {
    unityInstance.logo = document.createElement("div");
    unityInstance.logo.className = "logo " + unityInstance.Module.splashScreenStyle;
    unityInstance.container.appendChild(unityInstance.logo);
    }
    if (!unityInstance.progress) {
    unityInstance.progress = document.createElement("div");
    unityInstance.progress.className = "progress " + unityInstance.Module.splashScreenStyle;
    unityInstance.progress.empty = document.createElement("div");
    unityInstance.progress.empty.className = "empty";
    unityInstance.progress.appendChild(unityInstance.progress.empty);
    unityInstance.progress.full = document.createElement("div");
    unityInstance.progress.full.className = "full";
    unityInstance.progress.appendChild(unityInstance.progress.full);
    unityInstance.container.appendChild(unityInstance.progress);
    }
    unityInstance.progress.full.style.width = (100 * progress) + "%";
    unityInstance.progress.empty.style.width = (100 * (1 - progress)) + "%";
    if (progress == 1)
    unityInstance.logo.style.display = unityInstance.progress.style.display = "none";
    }

    把带logo的段落删掉,结果打开就报这错误。

    把原始版本放上,也不行,通过链接访问的所有的webgl都报这个错了。重启电脑,也不行

    猜想也许是跟MIME有关,把.unity3d 与.unityweb加入到MIME中,报重复错误,只能删掉,又把MIME服务、所有有关服务都重启然后就自己好了

  • 相关阅读:
    mysql数据库引擎myisam与innodb
    Java观察者模式的理解
    线程安全的单例模式
    线程相关
    java 线程读写锁
    原子变量AtomicInteger
    接口文档管理,版本管理工具,阿里RAP的windows下部署
    谷歌浏览器报错:跨域问题处理( Access-Control-Allow-Origin)_ 用于本地测试的快捷解决方法
    mysql bin-log日志记录
    阿里RDS中插入emoji 表情插入失败的解决方案
  • 原文地址:https://www.cnblogs.com/chenxiya/p/15141567.html
Copyright © 2011-2022 走看看