Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - Dev-tech

#1
Dejo a vuestra disposición Jamendo, un servidor de música ( con descarga gratuita ) para proyectos.
 
https://www.jamendo.com/
#2
Muchas Gracias por el aporte. 
#4
General (Antiguo) / no carga la scene
Marzo 01, 2017, 04:10:05 PM
Si usa el método OnClick del componente Button, verifica que lo tiene bien ajustado la configuración.
 

 
 
 
Jo to tengo con este código [ en c# ] y funciona correctamente.
 

public class MainMenu : MonoBehaviour {
// Init
void Start () {
   if (Application.isPlaying)
   {
      // Inciar juego
   }
}

// METHOD CLICKS
public void NewGame()
{   
   Debug.Log ("Nueva partida");
   SceneManager.LoadScene ("InitGame");
}
}

 
 
#5
Para implementar el ultimo post sobre los juego Multi-idioma [Post: Juego Multi-idiomas], puede implementar el detector de idiomas que he echo.
 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.IO;
public class UserManager : MonoBehaviour {
// Plataformas
public enum listPlatform
{
   Window, Linux, Mac
}
public listPlatform platform;
public bool       isNetActive    = false;
public string       langDetect       = "";
public string       lang          = "";
public float       widthScreen    = ;
public float       heightScreen    = ;
public string       resolution       = "";
// Pre-Init
void Awake()
{
   NetActive ();
   OS ();
   Language ();
   SizeScreen ();
}
// Comprovar si esta contectado a internet
void NetActive ()
{   
   string host = "www.google.es";
   try
   {
      System.Net.Dns.GetHostEntry(host);
      isNetActive = true;
   }
   catch(Exception e)
   {
      isNetActive = false;
   }
}

// Detectar Sistema Operativo
void OS()
{
   switch(Environment.OSVersion.Platform)
   {
      case PlatformID.Unix:
      if (Directory.Exists ("/Applications") &
         Directory.Exists ("/System") &
         Directory.Exists ("/Users")  &
         Directory.Exists ("/Volumes"))
            platform = listPlatform.Mac;
         else
            platform = listPlatform.Linux;
      break;
      case PlatformID.MacOSX:
         platform = listPlatform.Mac;
      break;
      default:
         platform = listPlatform.Window;
      break;
   }
}

// Detectar Idioma afitrión
void Language ()
{
   langDetect = Application.systemLanguage.ToString ();
   lang = ( langDetect == "Spanish" || langDetect == "English" ) ? langDetect : "English";
}

// Detectar tamaño de la pantalla y resolución
void SizeScreen()
{
   widthScreen       = Screen.width;
   heightScreen    = Screen.height;
   resolution       = Screen.currentResolution.ToString();
}
}

 
 
#6
Pongo a disposición de quien queda de mi sistema de juego multi-idioma.
 
Creo un carpeta donde pongo los XML  de la traducciones, en mi caso los puse en Resources/Language.
 

 
Para acceder a los XML y detectar el idioma del anfitrión uso los siguientes scripts.
 
 
 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Xml;
using System.Text;
public class LanguageManager : MonoBehaviour {

// Idioma
public string langName;
// Configuración
List < Dictionary< string,string > > languages = new List< Dictionary< string, string > >();
public Dictionary < string,string > obj;

     // Iniciar la traducción cuando se requira
public void Init()
{
   LoadLanguage ();
}

    // Setter y Getter del idioma
public string Language {
   set { langName = value; }
   get { return langName; }
}

     // Chequear el idioma antes de cargarlo, esto se debe que si no tienes el idioma del anfitrión, cargará en ingles.
string PathLanguage ()
{
   // Variable string
        string lang = "";
   
         // Chequeo el idioma por si lo tengo ya guardado
   if(PlayerPrefs.HasKey ("Language"))
   {
      lang = PlayerPrefs.GetString ("Language");
   }
   else
   {   
             // Compruevo si existe el idioma del anfitrión
      if (File.Exists (Application.dataPath.ToString () + "/Resources/Language/" + Language + ".xml"))
         lang = Language;
      else
         lang =  "English";

      PlayerPrefs.SetString ("Language",lang);
   }
   
         // Devuelvo la ruta chequeda
   return Application.dataPath.ToString() + "/Resources/Language/"+lang+".xml";
}
     
     // Cargar el idioma que viene de un XML
     void LoadLanguage ()
{
   
         // Ruta chequeada
   string path = PathLanguage ();
   
         // Recuperar datos del XML
   XmlDocument xml = new XmlDocument ();
   xml.Load (path);
   XmlNodeList langList = xml.GetElementsByTagName ("language");
   foreach (XmlNode lang in langList) {
      XmlNodeList content = lang.ChildNodes;
      obj = new Dictionary<string, string>();
      foreach(XmlNode val in content)
      {   
                 // Añadir los dato recopilado en una variable publica para su posterior procesado
         obj.Add (val.Name, val.InnerText);
      }
   }
   // Forma para imprimir el contenido
   Debug.Log (obj["Name"]);
}
}

 
Formato que tiene el XML
 

<?xml version="1.0" encoding="UTF-8" ?>
<language>
<Name>Spanish</Name>
<Txt_Btn_Exit>Salir</Txt_Btn_Exit>
<Txt_Btn_Option>Opciones</Txt_Btn_Option>
<Txt_Btn_Play>Comenzar partida</Txt_Btn_Play>
</language>

 
 
#7
General (Antiguo) / Hola desarrolladores
Marzo 01, 2017, 03:26:50 PM
Gracias, intentaré estar muy activo en el foro.
#8
General (Antiguo) / Hola desarrolladores
Febrero 27, 2017, 11:46:39 AM
Muy buenas a todos soy Sergio González de Dev-tech un pequeño desarrollador de aplicaciones informáticas e iniciado de Unity3D.