• unity3d webplayer 16:9 居中显示模板


    原地址:http://www.cnblogs.com/88999660/archive/2013/04/12/3016773.html

    <!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 | Shadow_Demo</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 screenWidth = parseInt($(document).width()*0.8);     
                var screenHeight = parseInt(screenWidth*0.56);
                var config = {
                     screenWidth, 
                    height: screenHeight,
                    params: { enableDebugging:"0" }
                    
                };
                
                config.params["disableContextMenu"] = true;
                config.params["backgroundcolor"] = "FFFFFF";
                config.params["bordercolor"] = "FFFFFF";
                config.params["textcolor"] = "FFFFFF";
                config.params["logoimage"] =  "Logo.png";
                config.params["progressbarimage"] =  "front.png";
                config.params["progressframeimage"] = "black.png";
    
                var u = new UnityObject2(config);
                
                function Login(msg){                
                    var user =getCookie("tourism_up");            
                    if(user !=""){
                        u.getUnity().SendMessage("Login", "LoginFromWebpage", user);
                    }
                }
    
                function getCookie(c_name)
                {
                if(document.cookie.length>0){
                   c_start=document.cookie.indexOf(c_name + "=")
                   if(c_start!=-1){ 
                     c_start=c_start + c_name.length+1 
                     c_end=document.cookie.indexOf(";",c_start)
                     if(c_end==-1) c_end=document.cookie.length
                     return unescape(document.cookie.substring(c_start,c_end))
                   }
                }
                return ""
                }
                jQuery(function() {
    
                    var $missingScreen = jQuery("#unityPlayer").find(".missing");
                    var $brokenScreen = jQuery("#unityPlayer").find(".broken");
                    var $unityPlayer = jQuery("#unityPlayer");
                    var $content = jQuery(".content");                
                    $content.height($(document).height());    
                    $content.width($(document).width());
                    $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], "0409.unity3d");
                    var $embed = $("embed");    
                    if(typeof($embed.css("display")) == "undefined"){
                        $embed = $("object")
                        }                
                    $embed.css("display","");
                });
            -->
            </script>
            <style type="text/css">
            <!--    
            *{margin:0}
            body {
                font-family: Helvetica, Verdana, Arial, sans-serif;
                background-color: white;
                color: black;
            }
            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 {            
                position: relative;
                display: table-cell;
                vertical-align:middle;
                text-align:center;
            }
            div.broken,
            div.missing {
                margin: auto;
                position: relative;
                top: 50%;
                 193px;
            }
            div.broken a,
            div.missing a {
                height: 63px;
                position: relative;
                top: -31px;
            }
            div.broken img,
            div.missing img {
                border- 0px;
            }
            div.broken {
                display: none;
            }
            div#unityPlayer {
                cursor: default;
            }
            -->
            </style>
        </head>
        <body>
    
            <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>
            </div>        
        </body>
    </html>

    弄了2个小时,拿去用的时候记得给个好评哦,亲~~~~~~~~~~~~~~~~~~。

  • 相关阅读:
    动态数组的实现案例
    随机验证码实现案例
    wince下的CPU和内存占用率计算
    RT-Thread--时间管理
    RT-Thread--线程管理
    RT-Thread--内核基础
    RT-Thread--简介
    Git基本操作
    STM32F103/429串口IAP+Ymodem升级
    KEIL_MDK生成Bin文件
  • 原文地址:https://www.cnblogs.com/123ing/p/3703882.html
Copyright © 2020-2023  润新知