当前位置:网站首页>Unity build error: the name "editorutility" does not exist in the current context

Unity build error: the name "editorutility" does not exist in the current context

2022-07-07 13:03:00 charlsdm

The reason for your error now is ,Unity Deleted at compile time for its design “UnityEditor” Namespace . This is why when you try to use it on the platform ,“EditorUtility” Will never exist except UnityEditor On any platform other than . because “EditorUtility” stay “UnityEditor” In the namespace .

therefore , If you want to use “EditorUtility” Execution and in Unity The same work done in the editor , You should implement it like them .

#if UNITY_EDITOR
EditorUtility.DisplayDialog(“Great!”, “You got the pattern right!”, “Next Level!”);
#else
YOUROWNCLASS.DisplayDialog(“Great!”, “You got the pattern right!”, “Next Level!”);
#endif

原网站

版权声明
本文为[charlsdm]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071045520857.html