Unity Spain

Post Antiguos => General (Antiguo) => Mensaje iniciado por: DogsLeg en Febrero 11, 2018, 11:51:52 PM

Título: Unity muestra muchas resoluciones iguales
Publicado por: DogsLeg en Febrero 11, 2018, 11:51:52 PM
Hola chicos, estoy trabajando en un menu principal, llego a la parte donde se puede seleccionar la resolucion entre las que estén disponibles en el dispositivo.
al hacerlo, desde el Editor se muestran las resoluciones tal y como deben estar, pero al compilar, aparecen muchas resoluciones iguales.
Les dejo un ejemplo
este es el codigo que estoy utilizando para mostrar las resoluciones y asignarlas:     
 



   
         int currentResolutionIndex = 0;        for (int i = 0; i < resolutions.Length; i++)        {             string option = resolutions .width + " x " + resolutions .height;            options.Add(option);            if (resolutions .width == Screen.currentResolution.width &&                resolutions .height == Screen.currentResolution.height) {                currentResolutionIndex = i;            }        }        resolutionDropdown.AddOptions (options);        resolutionDropdown.value = currentResolutionIndex;        resolutionDropdown.RefreshShownValue ();
   

[/quote]
 

Creí que era problema de mi maquina, pero probé con un paquete llamado "open Source Menu" y este si muestra bien las resoluciones una vez compilado, no se que pueda estar saliendo mal y agradeceria mucho su ayuda, ya que he buscado en diferentes sitios pero nada
 
 
(//%3CfileStore.core_Attachment%3E/monthly_2018_02/5a80c8a6438fe_Sinttulo.png.2b3f4c5e4caac43e45c1b54f6074710f.png)
Título: Unity muestra muchas resoluciones iguales
Publicado por: Braltor en Febrero 12, 2018, 12:27:01 AM
toma en cuenta q cada una tiene refreshRate's diferentes:
 
https://docs.unity3d.com/ScriptReference/Resolution-refreshRate.html (https://docs.unity3d.com/ScriptReference/Resolution-refreshRate.html)
Título: Unity muestra muchas resoluciones iguales
Publicado por: DogsLeg en Febrero 12, 2018, 12:35:06 AM
Cita de: Braltor date=1518391621toma en cuenta q cada una tiene refreshRate's diferentes:
   
   
      https://docs.unity3d.com/ScriptReference/Resolution-refreshRate.html (https://docs.unity3d.com/ScriptReference/Resolution-refreshRate.html)
   


Como puedo lograr que muestren solo un refresrate por cad resolución?

es decir, que solo muestre la de 59 hz por ejemplo de cada una
 
 
Título: Unity muestra muchas resoluciones iguales
Publicado por: Braltor en Febrero 12, 2018, 12:40:52 AM
ponle un if para q no añada la resolucion con un refreshRate diferente al q quieres

for (int i = 0; i < resolutions.Length; i++)
        {
                                       if (resolutions.refreshRate != miRefreshRate)
                                               continue;
                                       ...

 
 
Título: Unity muestra muchas resoluciones iguales
Publicado por: lightbug en Febrero 12, 2018, 12:47:51 AM
Quizás agregando algo así dentro del for ?
 

if(i > 0){
    if( (resolutions [i-1].width == resolutions .width) && (resolutions [i-1].height == resolutions .height))
     continue;
}