コード例 #1
0
    //public string name_user;

    private void Awake()
    {
        if (nameUser == null)
        {
            nameUser = this;
            DontDestroyOnLoad(gameObject);
            Debug.Log("es el 1");
            //user = usuario.text;
        }
        else if (nameUser != this)
        {
            Destroy(gameObject);
            Debug.Log("se destruye");
        }
    }
コード例 #2
0
    private void Start()
    {
        Screen.orientation = ScreenOrientation.Portrait;

        game_object   = GameObject.Find("login_registro_cs");
        loginRegistro = game_object.GetComponent <login_registro>();
        usuario       = loginRegistro.user;//Recuperando el usuario que hizo login

        reanudar = GameObject.Find("btnReanudar").GetComponent <Button>();
        //Verificar si el usuario tiene una partida (sacar el id del usuario, buscar su id en el json de partidas)

        nUsuario         = GameObject.Find("nUsuario").GetComponent <Text>();
        nUsuario.text    = usuario;
        reanudar.enabled = false;
        StartCoroutine("startID");      //Buscar el ID del usuario obtenido
        StartCoroutine("startPartida"); //Verificar si el usuario tiene una partida activa
    }