I do not know if I've learned very well what you want to do, but I can recommend this for what I understood:
In the first script, put the counter variable in public: public int contador;
(I recommend that the first letter of the variables be lowercase, I have seen that you have put Contador
).
In the second script, it grabs the reference of the first one. You can do it this way to make it easier: NombreDelScript cont;
Then, in the Unity editor, drag the object that has the first script into the new hole that will appear when you put the previous line of code. Finally, referring to cont
you can access the variable:
public void Contar(){
cont.contador; //Esto debería acceder a esa variable con el valor actualizado por el primer script.
}
I have not worked with Unity for a long time, I hope it works and that it helps you. If you have any questions, do not hesitate to answer me. Greetings.