Skip to content

Commit

Permalink
Fix issue when creating a custom asset
Browse files Browse the repository at this point in the history
Focusing the project window was causing Unity to change the selected
folder in the project window in the current versions of Unity. Put in
conditional directive to bypass this function when not in Unity 4.6.
Behavior appears to be the same - selects the asset, etc.
  • Loading branch information
Jaimi committed Dec 29, 2015
1 parent 1fdadf1 commit e2d31dd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ public static void CreateAsset<T>() where T : ScriptableObject
AssetDatabase.CreateAsset(asset, assetPathAndName);

AssetDatabase.SaveAssets();
EditorUtility.FocusProjectWindow();
// This line changes the folder in Unity 5.x
#if UNITY_4_6
EditorUtility.FocusProjectWindow();
#endif

Selection.activeObject = asset;
}
}
Expand Down

0 comments on commit e2d31dd

Please sign in to comment.