I am experiencing a very strange error using the latest version of unity, and the IDE is the visual studio 2015 community. I have a button that launches the function when clicked, and also sends a short string as a parameter. In the method, I first check if the string is empty or empty, and I run some code if in this case I run some other code (obviously the inscription). The problem is that the parameter is neither empty nor empty, however the first condition is triggered, I am 100% sure, because I registered the result of the operation, like this one Debug.Log("elementType : " + elementType + " result : " + string.IsNullOrEmpty(elementType));, and it basically prints fire.. false, also I started the debugger to make sure that this parameter is not empty, but it got even weirder after if the condition was called, the else statement was also activated!
Here's a video where I show the problem: http://screencast.com/t/iRtXtQaMDh8K .
And here is a screenshot of debug.log: http://prntscr.com/bv0xsg
I tried to restart both Unity and visual studio, but with no luck. I also put lockin a method if, in some magical way, some other thread turned to the same method at the same time, which, of course, is again wrong.
source
share