• 完整Deploy WebPlayer的Config


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
            <title>Unity Web Player | before</title>
            <script type='text/javascript' src='jquery.min.js'></script>
            <script type="text/javascript">
            <!--
            var unityObjectUrl = "UnityObject2.js";
            if (document.location.protocol == 'https:')
                unityObjectUrl = unityObjectUrl.replace("http://", "https://ssl-");
            document.write('<script type="text/javascript" src="' + unityObjectUrl + '"></script>');
            -->
            </script>
            <script type="text/javascript">
            <!--
                var config = {
                     960, 
                    height: 600,
                    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;
                        }
                    });
                    //第一个找到的unityPlayer div
                    u.initPlugin(jQuery("#unityPlayer")[0], "webplayer.unity3d");
                });
            -->
            </script>
            <style type="text/css">
            <!--
            body {
                font-family: Helvetica, Verdana, Arial, sans-serif;
                background-color: white;
                color: black;
                text-align: center;
            }
            a:link, a:visited {
                color: #000;
            }
            a:active, a:hover {
                color: #666;
            }
            p.header {
                font-size: small;
            }
            p.header span {
                font-weight: bold;
            }
            p.footer {
                font-size: x-small;
            }
            div.content {
                margin: auto;
                width: 960px;
            }
            div.broken,
            div.missing {
                margin: auto;
                position: relative;
                top: 50%;
                width: 193px;
            }
            div.broken a,
            div.missing a {
                height: 63px;
                position: relative;
                top: -31px;
            }
            div.broken img,
            div.missing img {
                border-width: 0px;
            }
            div.broken {
                display: none;
            }
            div#unityPlayer {
                cursor: default;
                height: 600px;
                width: 960px;
            }
            -->
            </style>
        </head>
        <body>
            <p class="header"><span>Unity Web Player | </span>before</p>
            <div class="content">
                <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>
            </div>
            <p class="footer">&laquo; created with <a href="http://unity3d.com/unity/" title="Go to unity3d.com">Unity</a> &raquo;</p>
        </body>
    </html>

    注意这两句里的missing和broken class有上面jquery来控制进度是否需要安装plugin

  • 相关阅读:
    tornado用户指引(三)------tornado协程使用和原理(二)
    利用tornado使请求实现异步非阻塞
    在tornado中使用异步mysql操作
    Tornado 线程池应用
    Tornado异步与延迟任务
    tornado用户指引(二)------------tornado协程实现原理和使用(一)
    Tornado用户指引(一)-----------异步和非阻塞I/O
    Tornado异步之-协程与回调
    Python核心框架tornado的异步协程的2种方式
    c++ Map使用
  • 原文地址:https://www.cnblogs.com/shawnzxx/p/3623208.html
Copyright © 2020-2023  润新知