Final build does not update edited data

Good afternoon.

Sorry for wrong writing.
My language is not English and that’s why I already have difficulties understanding several things, I’m not a professional in the area, but I’ve been developing an independent project alone and so far I’ve been successful, but I’m having problems compiling the game.

USING:
Windows 10
Unity 2022.3.20f1
Visual Studio 2022

EXPLANATION:
I’m creating a game that is working correctly within unity (playmode), but it doesn’t work the same way in the build game (compiling for standalone windows).

PROBLEM:
When I test the game in playmode it works correctly.
When I copy it into build and run, it doesn’t work correctly.

I noticed that when I edit a script or model or anything, unity does not recreate the compilation with the new information and only shows the first one that was made.

ATTEMPTS:

I’ve already searched on Google and only things come up regarding online or Android data updates, but I want to talk about building the game and not about data or about online and other platforms.

I have already turned off and turned on the PC again.

I already deleted the libraries folder.

I’ve already created a new project and it always only creates the first build I generate and doesn’t even assign a new change when I edit something and recompile. It always goes back to the first one.

If there is a bug, what should I do?
If it is configuration, where and how should I configure, I need instructions in this case.

Note that in old versions, all you had to do was click on build and run which generated a compilation of the current project and in this new version of unity I have this problem.
As mentioned, the changes are not updating, and therefore there is no error to report in the console.

I appreciate everyone’s attention for solutions.

Exemple code:

    //This method is a fist method create
    private void GetDate(string data){

        GameObject objUI = GameObject.Find("ObjUI");
        TextMeshProUGUI textUI = objUI.GetComponent<TextMeshProUGUI>();
        textUIEndereco.text = data;
        //Is working alright.
    }

    //This method is a method update and not read in copilation
    private void GetDate(string data){

        GameObject objUI = GameObject.Find("ObjUI");
        TextMeshProUGUI textUI = objUI.GetComponent<TextMeshProUGUI>();

        if(data.Equals("")){

            textUIEndereco.text = "Not data";

        }else{

            textUIEndereco.text = data;

        }

        //Not owrking. No read 'if' and 'else'.
    }

Read the device logs and see if you’re getting any exceptions.

ALSO: do not use this command:

More information: https://starmanta.gitbooks.io/unitytipsredux/content/first-question.html

More information: https://discussions.unity.com/t/899843/12

In general, DO NOT use Find-like or GetComponent/AddComponent-like methods unless there truly is no other way, eg, dynamic runtime discovery of arbitrary objects. These mechanisms are for extremely-advanced use ONLY.
If something is built into your scene or prefab, make a script and drag the reference(s) in. That will let you experience the highest rate of The Unity Way™ success of accessing things in your game.

Obrigado pela resposta. Mas infelizmente não tem nada a ver com o problema.

No projeto original não utilizo GameObjEct.Find fiz isso aqui porque é um exemplo de código onde coloquei um texto de ui para mostrar os dados recebidos.

Como descrevi, o primeiro método mostra a informação, quando adicionei o tratamento ‘if’ ao “else” para verificar se os dados existiam, o Unity não copiou isso para o jogo final.
Não faz nada, não passa as informações para a UI.
Mas se eu deixar o código igual ao primeiro método novamente, funciona.

Estou pegando esses dados de duas maneiras
um é Resources.Load(caminho);
e o outro é
Arquivo FileStream = novo FileStream (caminho, FileMode.Open, FileAccess.Read);
StreamReader sr = novo StreamReader(arquivo);
DadosArquivo = sr.ReadToEnd();
sr.Fechar();
arquivo.Fechar();

Independente de como eu pego os dados de um arquivo .txt, ele sempre retorna os valores normalmente.

Coloquei debug.log no método que recebe esses dados e ele coloca no texto da UI. Tudo normal.
Porém, se eu tento usar esses dados que estão em uma string, ele só funciona no playmode e não no jogo compilado.

Thanks for the answer. But unfortunately it has nothing to do with the problem.

In the original project I don’t use GameObjEct.Find I did this here because it is a code example where I placed a UI text to show the received data.

As I described, the first method shows the information, when I added the ‘if’ treatment to the “else” to check if the data existed, Unity didn’t copy this into the final game.
It doesn’t do anything, it doesn’t pass the information to the UI.
But if I leave the code the same as the first method again, it works.

I’m getting this data in two ways
one is Resources.Load(path);
and the other is
FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(file);
FileData = sr.ReadToEnd();
sr.Close();
file.Close();

Regardless of how I get the data from a .txt file, it always returns the values normally.

I put debug.log in the method that receives this data and it puts it in the UI text. Everything normal.
However, if I try to use this data that is in a string, it only works in playmode and not in the compiled game.