Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
topameng committed Aug 9, 2019
2 parents d028174 + 2181e61 commit 796160f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Assets/ToLua/Core/ToLua.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,11 @@ public static bool OnOpenAsset(int instanceID, int line)
if (path.EndsWith(fileName) || path.EndsWith(fileName + ".bytes"))
{
UnityEngine.Object obj = AssetDatabase.LoadMainAssetAtPath(path);
AssetDatabase.OpenAsset(obj, line);
if (Application.isPlaying) {
EditorApplication.delayCall = delegate(){ AssetDatabase.OpenAsset(obj, line); };
} else {
AssetDatabase.OpenAsset(obj, line);
}
return true;
}
}
Expand Down

0 comments on commit 796160f

Please sign in to comment.