CodingJar

Fix Crashes in Unity Project

Jun 6th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. /**
  2.  * Does your editor misbehave, hard crash on string compares, and refuse to drag n drop objects into your scene?
  3.  * Use this menu item, it could be the cause of your misfortunes.
  4.  */
  5.         [MenuItem("Coding Jar/Fix FallbackEditor Windows")]
  6.         static void FixFallbackEditorWindows()
  7.         {
  8.             var type = Types.GetType( "UnityEditor.FallbackEditorWindow", "UnityEditor" );
  9.             var allEditorWindows = Resources.FindObjectsOfTypeAll( type );
  10.             foreach( var wind in allEditorWindows )
  11.             {
  12.                 Object.DestroyImmediate( wind, true );
  13.             }
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment