I have found that for some reason the integration between VisualStudio and unity is thoroughly broken.
For example, putting a certain string in the Hierarchy window, I’m trying to figure out what this string is.
I’m not sure what this string is, but I’m guessing it’s “→”, and I get a lot of the following errors.
Version control state is not supported for game object hierarchy
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
When this error occurs, you will not be able to reference certain assets from C# scripts.
For example, a description using a class called “UISprite” or “UILabel” that is included in an asset called NGUI will result in an error because the class cannot be found.
Of course, those descriptions were working without any problems until this error occurred.
The reason for this is that the following description is removed from Assembly-CSharp-Editor-firstpass.csproj by several hundred lines.
- .
However, not only “Assembly-CSharp-Editor-firstpass.csproj”, but also “Assembly-CSharp-Editor.csproj”, “Assembly-CSharp-firstpass.csproj”, “Assembly- CSharp.csproj”.
It is difficult to undo the changes to only certain files.
There is no solution to this problem, such as rebuilding or compiling, and there is no solution other than undoing all the work done by git, no matter what work is in progress.
Annoyingly, this problem occurs outside of searching the Hierarchy window, and I have lost several hours of work to it.
Is there any way to prevent this unpleasant problem from occurring, or to fix it when it does occur?
----------The following is the original text in Japanese.-------------------------------
私は何らかの理由でVisualStudioとunityの連携が徹底的に破壊されることを発見しました。
例えば、Hierarchyウィンドウに特定の文字列を入れる、この文字列が何かは調査中で、
恐らくは「→」だと思いますが、以下のエラーが大量に発生します。
Version control state is not supported for game object hierarchy
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
このエラーが発生すると、C#のスクリプトから特定のアセットを参照できなくなります。
例えば、NGUIというアセットに含まれるクラス、「UISprite」だとか、「UILabel」を使用した記述は、それらのクラスが見つからずエラーになります。
当然、それらの記述はこのエラーが起きるまで何の問題もなく動作していました。
その理由はAssembly-CSharp-Editor-firstpass.csprojの中から以下のような記述が数百行削除されるからです。
しかし、「Assembly-CSharp-Editor-firstpass.csproj」だけでなく、「Assembly-CSharp-Editor.csproj」、「Assembly-CSharp-firstpass.csproj」、「Assembly-CSharp.csproj」といった、
通常触ることのないファイルも変更されおり、特定のファイルだけを元に戻すというのは困難です。
この問題はリビルドやコンパイルなどどいった解決方法が見つかっておらず、いかなる作業中であっても、gitによってすべての作業を元に戻す以下の解決策がありません。
困ったことにこの問題は、Hierarchyウィンドウの検索以外でも発生し、私はこれによって数時間の作業を失いました。
この不快極まる問題を起こさない、あるいは起きたときに問題を解決する方法はないでしょうか。
