I've a project in Unity 2018.2.21f1. I have already a C# script for handling coins in my game, called CoinHandler.
It already as a gameobject in the scene, and it has linked some components (text) that it has to update.
Then I've a button added to the scene (as you can see in the first picture), and I try to call a function from the previous script in his on click() event. For this, I go to the inspector and drag&drop the coinHandler gameObject, and select the desired function (method, since it returns void).
You may notice that the icon of the gameObject in this picture changes to the script icon. I don't know if this is a bad sign, but just notice it. It changes just after selecting the function. Before, it remains with its proper icon:
And finally, in the console I'm getting the next warning:
No script asset for GameObjectSelectionItem. Check that the definition is in a file of the same name.
Of course, both name of the script and of the class inside it are the same.
I've readed that this may be because of having the animator window open. I had, but I closed it, and everything was the same, fixed nothing.
Any idea about why may be happening?




EventSystemin your scene?