public static void RestorePreviousPersistentTool() { var last = EditorToolContext.GetLastTool(x => x && !EditorToolUtility.IsCustomEditorTool(x.GetType())); if (last != null) { SetActiveTool(last); } else { SetActiveTool <MoveTool>(); } }
static bool IsCustomEditorTool(EditorTool tool) { return(EditorToolUtility.IsCustomEditorTool(tool != null ? tool.GetType() : null)); }