Maybe it's because vcpkg is on another drive?Ĭan you explain what you mean by vcpkg? Have you installed boost via some form of package manager? Perhaps NuGet? If so, what method have you used? What should I do? It's definitely a Visual Assist error, as it works fine with IntelliSense. In general, most Visual Assists features do not work properly. There is no autocomplete (also for header files), namespaces are not colored correctly. I've just installed Visual Assist and I noticed vcpkg is not working correctly.
#Visual assist whole tomato software#
I see, thats interesting.Whole Tomato Software Forums - No autocomplete with vcpkg Always something new to learnĬertainly valid and reasonable C# code, even if not always as clear as it could be, and VA should handle this correctly, hence the bug report. It turns out to be a C# language feature, nothing to do with Unity its self, but it took a bit of reading to figure that out. When I started trying to understand the problem I wasn't sure if this was a Unity specific problem, or a feature of the C# language its self that VA did not properly handle.
But if you're just trying to use it in a single place in your cs file, then you would just use GetComponent().MyBool The reason why you would create reference to the component first and then access methods/properties through that reference is usually for readability, esp if its used in multiple places. Happens in indie projects or small game studios like the one I'm working at.
#Visual assist whole tomato code#
This kind of things tend to happen when multiple people work on the same file over long periods of time and sometimes they are just trying to get a hotfix done to get rid of a bug or something and there are no strict code reviews. In this case what happened probably was that the first person who worked on this class maybe created a variable that references the component but other people who worked on it later didn't realize a reference already existed so they just did GetComponent again. Maybe that was not exactly the reason in this case (I didnt write the code that I screenshotted to be honest) but there are valid reasons to do it that way like I described above. This is less performant because you then have to retrieve a reference to an object from heap and also it takes up more lines of code for not much benefit. We dont always create a variable to store the value of GetComponent() and then use that reference to call a function or get a property of that component. I see, thank you for looking into it and making a bug report. In the unity documentation, the type of the return from GetComponent is set clearly with a new variable before being used, which would obviously help VA to follow what is going on, but is also not how your code is written. Interestingly in the very simple example shown here: VA is not working out the correct type when the generic function is returning a generic type, I have put in a bug report for this:
Zen is the art of being at one with the two'ness I am seeing the same problem here, I am looking into what is going on with these generic functions in C#. Here are Visual Assist's "Find References"(Alt + Shift + F) results:Īnd here is Visual Studio's "Find All References" results (Shift + F12):Īs you can see, Visual Studio found 4 more references than Visual Assist. The reason galaxy looks different in the screenshot is just that I had also made a Ctrl+F search for "Galaxy", however, if I go to the bool's declaration at the top of the class, and then do VA's find references, it doesn't find the instances where the bool is accessed through Unity's GetComponent(). via pressing ESC), then it should work after. In this case, Visual Assist throws this same error message that you show on the screenshot if VA Find References is triggered. When you use the Find feature of Visual Studio, or you just press F3 to continue searching, Visual Studio selects the text you are searching for. I think this happens only when the trying to find reference to it after using "GetComponent()"ĭid you select part of the symbol name? The background color of "Galaxy" is different.
When trying to find the places where the bool "AllowGalaxyMenyPopUp" is referenced I get an error that says "Find References is not available because the symbol unrecognized" I'm programming in C# in Unity (the game engine). Whole Tomato Software Forums - Can't find references to variable in C# in UnityĬan't find references to variable in C# in Unity