Search Unity

I'm a noob whit this subject .php

Discussion in 'Scripting' started by Nixel2013, Aug 4, 2019.

  1. Nixel2013

    Nixel2013

    Joined:
    May 9, 2019
    Posts:
    143
    Assets\GuardarPuntaje\ActualizarPuntaje.cs(22,19): error CS0117: 'Gestion8D' does not contain a definition for 'singLeton'

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class ActualizarPuntaje : MonoBehaviour
    7. {
    8.     // Start is called before the first frame update
    9.     void Start()
    10.     {
    11.  
    12.     }
    13.  
    14.     // Update is called once per frame
    15.     void Update()
    16.     {
    17.  
    18.     }
    19.  
    20.     public void ChangeScore(int nScore)
    21.     {
    22.         Gestion8D.singLeton.Puntaje_Actualizar(nScore);
    23.     }
    24.  
    25. }

    Assets\GuardarPuntaje\Gestion8D.cs(99,23): error CS0029: Cannot implicitly convert type 'int' to 'string'

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.UI;
    5.  
    6. public class Gestion8D : MonoBehaviour
    7. {
    8.     public InputField txtUsuario;
    9.     public InputField txtPuntaje;
    10.  
    11.     public string NombreDeUsuario;
    12.     public string Puntaje;
    13.     public bool sesionIniciada;
    14.  
    15.     /// Repuesta Web
    16.     ///     400 - No pudo estrablecer conección
    17.     ///     401 - No encontró datos
    18.     ///     402 - El Usuario ya existe
    19.     ///     200 - Datos encontrados
    20.     ///     201 - Usuario Registrado
    21.     ///     202 - Puntaje Actualizado
    22.     ///
    23.  
    24.  
    25.  
    26.  
    27.     public void iniciarSesion()
    28.     {
    29.         //StartCoroutine(Login());
    30.         //StartCoroutine(Datos());
    31.     }
    32.  
    33.     public void registrarUsuario()
    34.     {
    35.         StartCoroutine(Registrar());
    36.         //StartCoroutine(Datos());
    37.     }
    38.  
    39.     public void Puntaje_Actualizar(int nScore)
    40.     {
    41.         StartCoroutine(ActualizarPuntaje(nScore));
    42.    
    43.     }
    44.  
    45.  
    46.  
    47.  
    48.     /*  IEnumerator Login()
    49.       {
    50.           WWW coneccion = new WWW("http://localhost/jugadores/login.php?uss=" + txtUsuario.text + "&pss=" + txtPuntaje.text);
    51.           yield return (coneccion);
    52.           if (coneccion.text == "200")
    53.           {
    54.               print("El Usuario si Existe");
    55.           }
    56.           else if (coneccion.text == "401")
    57.           {
    58.               print("El Usuario o Puntaje son incorrecto");
    59.           }
    60.           else
    61.           {
    62.               print("Error de la Conexion con la Base de Datos");
    63.           }
    64.       }*/
    65.  
    66.     IEnumerator Registrar()
    67.     {
    68.         WWW coneccion = new WWW("http://localhost/jugadores/registro.php?uss=" + txtUsuario.text + "&pss=" + txtPuntaje.text);
    69.         yield return (coneccion);
    70.         if (coneccion.text == "401")
    71.         {
    72.             Debug.LogError("El Usuario ya existe");
    73.         }
    74.         else if (coneccion.text == "402")
    75.         {
    76.                 NombreDeUsuario = txtUsuario.text;
    77.                 int Puntaje = 0;
    78.             sesionIniciada = true;
    79.             }
    80.         else
    81.         {
    82.            // print(coneccion.text);
    83.            //Debug.LogError("Error de la Conexion con la Base de Datos");
    84.         }
    85.  
    86.     }
    87.  
    88.     IEnumerator ActualizarPuntaje(int nScore)
    89.     {
    90.         WWW coneccion = new WWW("http://localhost/jugadores/score.php?uss=" + txtUsuario.text + "&nScore=" + nScore.ToString());
    91.         yield return (coneccion);
    92.         if (coneccion.text == "401")
    93.         {
    94.             Debug.LogError("El Usuario no existe");
    95.         }
    96.         else if (coneccion.text == "202")
    97.         {
    98.             print("Datos Actualizados Correstamente");
    99.             Puntaje = nScore;
    100.         }
    101.         else
    102.         {
    103.             // print(coneccion.text);
    104.             //Debug.LogError("Error de la Conexion con la Base de Datos");
    105.         }
    106.  
    107.     }
    108.  
    109. }
    110.