Javascript Angular js:从Angular js加载Unity Web导出

Javascript Angular js:从Angular js加载Unity Web导出,javascript,jquery,angularjs,web-applications,unity3d,Javascript,Jquery,Angularjs,Web Applications,Unity3d,我的名字是Juan Camilo Guarin p。我一直在做一个项目,我需要使用Unity web导出的html从angularjs加载一个unity3d文件 问题是,Unity 3d通过jquery加载内容,但即使我已经将其包含到html文件中,也无法正确加载内容 这里我默认包括脚本和html Unity 3d导出: 首先是脚本: var unityObjectUrl = "http://webplayer.unity3d.com/download_webplayer-3.x/3.0

我的名字是Juan Camilo Guarin p。我一直在做一个项目,我需要使用Unity web导出的html从angularjs加载一个unity3d文件

问题是,Unity 3d通过jquery加载内容,但即使我已经将其包含到html文件中,也无法正确加载内容

这里我默认包括脚本和html Unity 3d导出:

首先是脚本:

    var unityObjectUrl = "http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js";
    if (document.location.protocol == 'https:')
    unityObjectUrl = unityObjectUrl.replace("http://", "https://ssl-");
    document.write('<script type="text\/javascript" src="' + unityObjectUrl + '"><\/script>');

    var config = {
        width: $(window).width() / 1.2,
        height: $(window).height() / 1.2,
        params: {enableDebugging: "0"}
        };
    var u = new UnityObject2(config);
    jQuery(function() {
           var $missingScreen = jQuery("#unityPlayer").find(".missing");
           var $brokenScreen = jQuery("#unityPlayer").find(".broken");
           $missingScreen.hide();
           $brokenScreen.hide();
           u.observeProgress(function(progress) {
                    switch (progress.pluginStatus) {
                           case "broken":
                                 $brokenScreen.find("a").click(function(e) {
                                        e.stopPropagation();
                                        e.preventDefault();
                                            u.installPlugin();
                                        return false;
                                        });
                                 $brokenScreen.show();
                                 break;
                           case "missing":
                                 $missingScreen.find("a").click(function(e) {
                                        e.stopPropagation();
                                        e.preventDefault();
                                        u.installPlugin();
                                        return false;
                                        });
                                 $missingScreen.show();
                                 break;
                           case "installed":
                                 $missingScreen.remove();
                                 break;
                           case "first":
                                 break;
                      }
            });
    u.initPlugin(jQuery("#unityPlayer")[0], "recorridovirtual.unity3d");
                                });
var unityObjectUrl=”http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js";
如果(document.location.protocol==“https:”)
UNITYOBJECTARL=UNITYOBJECTARL.replace(“http:/”,”https://ssl-");
文件。写(“”);
变量配置={
宽度:$(窗口).width()/1.2,
高度:$(窗口).height()/1.2,
参数:{enableDebugging:“0”}
};
var u=新单元对象2(配置);
jQuery(函数(){
var$missingScreen=jQuery(“#unityPlayer”).find(“.missing”);
var$brokenScreen=jQuery(“#unityPlayer”).find(“.breaked”);
$missingScreen.hide();
$brokenScreen.hide();
u、 观察进度(功能(进度){
开关(progress.pluginStatus){
“破碎”案例:
$brokenScreen.find(“a”)。单击(函数(e){
e、 停止传播();
e、 预防默认值();
u、 installPlugin();
返回false;
});
$brokenScreen.show();
打破
“失踪”一案:
$missingScreen.find(“a”)。单击(函数(e){
e、 停止传播();
e、 预防默认值();
u、 installPlugin();
返回false;
});
$missingScreen.show();
打破
“已安装”案例:
$missingScreen.remove();
打破
案例“第一”:
打破
}
});
u、 initPlugin(jQuery(“#unityPlayer”)[0],“recorridovirtual.unity3d”);
});
此脚本位于html文件中的脚本标记之间。现在,这就是工作的html:

<div id="unityPlayer">
            <div class="missing">
                <a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!">
                    <img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" />
                </a>
            </div>
            <div class="broken">
                <a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now! Restart your browser after install.">
                    <img alt="Unity Web Player. Install now! Restart your browser after install." src="http://webplayer.unity3d.com/installation/getunityrestart.png" width="193" height="63" />
                </a>
            </div>
        </div>

在头部,它包括:

    <script type='text/javascript' src='https://ssl-webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/jquery.min.js'></script>

现在,我想做什么

我想加载.unity3d文件,并使用angular js将其名称动态更改为html

这一切的发生是因为,我也不知道如何包含或使用我在angular js上的控制器中定义的变量。如果我知道的话,只需替换unity3d文件的名称并加载另一个文件就很容易了,但就我所搜索的而言,我还没有看到这个问题的任何答案,现在我正试图以一种角度来完成所有这一过程

如果你能回答我的问题,我将不胜感激

非常感谢你们所有人,我知道应该还有其他人有同样的怀疑


胡安·卡米洛·瓜林p.

你的名字与此无关,也不必过分客气。事实上,最好直接开始问题摘要,然后是事实和代码,还有一个问题。不需要谢谢、签名或其他任何东西。因此,用户的核心是务实的谢谢你的评论,我在问一个问题,我还没有看到任何回应。无需纠正我对平台的使用,只要问题是可以理解的。如果你像写电子邮件一样写问题,它确实会阻止我阅读,这反过来会降低获得答案的可能性。