• Benvenuto in Making Videogames!
  • Dai sfogo alla tua fantasia!
  • Crea il tuo Videogioco!
Benvenuto ospite! Login Registrati




Valutazione discussione:
  • 0 voto(i) - 0 media
  • 1
  • 2
  • 3
  • 4
  • 5
Player piccolo, piccolo
#4
Ciao scusa la tarda risposta:
dove sto leggendo io un utente manda questo codice che gli da questi errori:
From various alert()s in the code, I can verify that ResizeUnity() is being called when I change the size of the window. I can verify that winWidth and winHeight are getting proper values assigned to them upon resizing. But, no matter what I do to the browser window, the Unity WebPlayer object stays the same size it was when it was loaded.

Codice PHP:
<!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>

       <
script type="text/javascript">

       <!--

       function 
GetUnity() 

       {

         if (
typeof unityObject != "undefined"

         {

          return 
unityObject.getObjectById("unityPlayer");

         }

         return 
null;

       }

 

       function 
ResizeUnity()

       {

         
//This function properly assigns innerWidth and Height to winWidth and winHeight

         
GetWindowSize();

 

         var 
unity GetUnity();

         if(
unity != null)

         {

          
//This does not properly resize anything at all

          
unity.width winWidth;

          
unity.height winHeight;

         }

       }

    }

 

    if (
typeof unityObject != "undefined"

    {

       
GetWindowSize();

       
unityObject.embedUnity("unityPlayer""WebPlayer.unity3d"winWidthwinHeightparams);       

    }

    -->

    </
script>

    <
style type="text/css">

    <!--

    
div#unityPlayer {

       
cursor: default;

       
height100%;

       
width100%;

    }

    -->

    </
style>

    </
head>

    <
body margin="0" marginwidth="0" marginheight="0" scroll="no" onResize="ResizeUnity()">

       <
div class="content">

         <
div id="unityPlayer">

          <
div class="missing">

              <
a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!">

              </
a>

          </
div>

         </
div>

       </
div>

    </
body>

</
html

quindi un utente gli manda quel script che ti ho dato prima:
It seems the GetUnity() function wasn't grabbing an element high enough up its div hierarchy for me to resize the correct element. Updating my ResizeUnity() function with this did the trick(codice sopra)
ps: questo script è per ridimensionare il player quindi penso che lo puoi fare delle misure che ti servono.
 
Rispondi
  


Messaggi in questa discussione
Player piccolo, piccolo - da Kuroko - 07-12-2012, 12:51 PM
RE: Player piccolo, piccolo - da Exorcist - 07-12-2012, 12:56 PM
RE: Player piccolo, piccolo - da Kuroko - 07-12-2012, 02:01 PM
RE: Player piccolo, piccolo - da Exorcist - 07-12-2012, 09:52 PM

Discussioni simili
Discussione Autore Risposte Letto Ultimo messaggio
  Addio al Web Player di Unity Chip 0 679 10-10-2015, 01:41 PM
Ultimo messaggio: Chip
  controllo player 3 persona giggimito 0 588 19-04-2015, 03:11 PM
Ultimo messaggio: giggimito
  Iniziare a programmare un videogioco.. Un piccolo aiuto? Biagino 28 2,494 10-08-2014, 04:10 PM
Ultimo messaggio: Biagino
Exclamation teletrasporto player in unity 3D leoMetal 4 1,445 02-04-2013, 04:57 PM
Ultimo messaggio: abcd
  giochi web player gufo92 1 839 11-02-2013, 10:07 AM
Ultimo messaggio: THB93
  Web player vs exe gufo92 6 947 27-07-2012, 03:21 PM
Ultimo messaggio: marf
  danno al player andrea nocentini 0 654 29-06-2012, 02:05 AM
Ultimo messaggio: andrea nocentini
  aggiungere rumore passi al mio player ugavle 2 1,860 25-02-2012, 04:24 PM
Ultimo messaggio: ugavle
  1000 Player FPS, World Record - 29 Jan 2012 Skyline 22 2,802 03-02-2012, 09:55 AM
Ultimo messaggio: KillerZ

Vai al forum:


Browsing: 1 Ospite(i)