Unit error assertion failed on expression

       
       

       
The

error occurs when you write to an editor, such as the log redirection described earlier, and occurs when you double-click.

problem is solved by locating the specific code, and then delaying the execution of this line of code. The delay time is when the editor GUI is updated, there is a corresponding callback in unity, and the code can be executed by putting it in the callback. For example, the log redirection corresponds to the following change:

EditorApplication.delayCall = delegate(){ AssetDatabase.OpenAsset(obj, line); };
  
  • 1

Read More: