Я только что создал проект Unity с чистой установкой, также создал сценарий C # и привязал его к трехмерному игровому объекту (Cube), но когда я дважды щелкаю, чтобы открыть сценарий, он сразу говорит:
Exception thrown while invoking [OnOpenAssetAttribute] method 'Unity.CodeEditor.CodeEditor:OnOpenAsset (int,int,int)' : InvalidOperationException: Cannot start process because a file name has not been provided.
System.Diagnostics.Process.Start () (at <d465e2b2e5054d2787d6364114c43446>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
UnityEditor.DefaultExternalCodeEditor.OpenProject (System.String path, System.Int32 line, System.Int32 column) (at C:/buildslave/unity/build/Editor/Mono/CodeEditor/DefaultExternalCodeEditor.cs:96)
Unity.CodeEditor.CodeEditor.OnOpenAsset (System.Int32 instanceID, System.Int32 line, System.Int32 column) (at C:/buildslave/unity/build/Editor/Mono/CodeEditor/CodeEditor.cs:56)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
и
InvalidOperationException: Cannot start process because a file name has not been provided.
System.Diagnostics.Process.Start () (at <d465e2b2e5054d2787d6364114c43446>:0)
(wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
UnityEditor.DefaultExternalCodeEditor.OpenProject (System.String path, System.Int32 line, System.Int32 column) (at C:/buildslave/unity/build/Editor/Mono/CodeEditor/DefaultExternalCodeEditor.cs:96)
Unity.CodeEditor.CodeEditor.OpenFileAtLineColumn (System.String path, System.Int32 line, System.Int32 column) (at C:/buildslave/unity/build/Editor/Mono/CodeEditor/CodeEditor.cs:31)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
И если я, например, попытаюсь использовать Debug.Log
в скрипте, он скажет
'Debug' does not contain a definition for 'Log'
Ничего не работает.
Я уже пытался открыть Unity, создать другой проект, установить другую версию (сейчас я использую последнюю версию 2019.2.0b1), и это всегда происходит, я использую Visual Studio, и ошибки выводятся в консоли Unity..