{"record":{"id":"4579a9d6758a48f1","repo":"Unity-Technologies/UnityCsReference","slug":"use-drawoutline-entityid-entityid-color-col","errorCode":null,"errorMessage":"Use DrawOutline(EntityId[], EntityId[], Color, Color, float) instead.","messagePattern":"Use DrawOutline\\(EntityId\\[\\], EntityId\\[\\], Color, Color, float\\) instead\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/Handles/Handles.cs","lineNumber":1544,"sourceCode":"        }\n\n        // Returns actual rectangle where the camera will be rendered\n        internal static Rect GetCameraRect(Rect position)\n        {\n            Rect screenRect = GUIClip.Unclip(position);\n            Rect cameraRect = new Rect(screenRect.xMin, Screen.height - screenRect.yMax, screenRect.width, screenRect.height);\n            return cameraRect;\n        }\n\n        // Get the size of the main playModeView window\n        public static Vector2 GetMainGameViewSize()\n        {\n            return PlayModeView.GetMainPlayModeViewTargetSize();\n        }\n\n        [Obsolete(\"Deprecated. Use DrawOutline(EntityId[], EntityId[], Color, Color, float) instead.\",true)]\n        public static void DrawOutline(int[] parentRenderers, int[] childRenderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)\n            => throw new InvalidOperationException(\n                \"Use DrawOutline(EntityId[], EntityId[], Color, Color, float) instead.\");\n        public static void DrawOutline(EntityId[] parentRenderers, EntityId[] childRenderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)\n        {\n            if(Event.current.type != EventType.Repaint)\n                return;\n            Internal_DrawOutline(parentNodeColor, childNodeColor, EntityId.None, parentRenderers, childRenderers, OutlineDrawMode.SelectionOutline, fillOpacity, fillOpacity);\n            Internal_FinishDrawingCamera(Camera.current, true);\n        }\n\n        [Obsolete(\"Deprecated. Use DrawOutline(EntityId[], Color, float) instead.\", true)]\n        public static void DrawOutline(int[] renderers, Color color, float fillOpacity = 0) =>\n            throw new InvalidOperationException(\n                \"Use DrawOutline(EntityId[], Color, float) instead.\");\n        public static void DrawOutline(EntityId[] renderers, Color color, float fillOpacity = 0) =>\n            DrawOutline(renderers, null, color, color, fillOpacity);\n\n        public static void DrawOutline(Renderer[] renderers, Color parentNodeColor, Color childNodeColor, float fillOpacity = 0)\n        {","sourceCodeStart":1526,"sourceCodeEnd":1562,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Handles/Handles.cs#L1526-L1562","documentation":"The DrawOutline overload accepting int[] arrays (instance IDs) is marked [Obsolete(..., true)] and always throws InvalidOperationException. Unity migrated the selection outline system from int instance IDs to EntityId structs; the replacement overload takes EntityId[].","triggerScenarios":"Calling Handles.DrawOutline(int[], int[], Color, Color, float) from source code (compile error) or via reflection (runtime throw).","commonSituations":"Post-upgrade code or third-party packages that pass instance ID arrays to DrawOutline for selection outlines; common in Hierarchy or Scene view extensions.","solutions":["Convert int[] instance IDs to EntityId[] and call the EntityId overload.","Alternatively, pass Renderer[] directly and use the Renderer[]-based overloads that handle conversion internally."],"exampleFix":"// before\nHandles.DrawOutline(parentIds, childIds, parentColor, childColor);\n// after\nEntityId[] parentEntityIds = Array.ConvertAll(parentIds, id => (EntityId)id);\nEntityId[] childEntityIds = Array.ConvertAll(childIds, id => (EntityId)id);\nHandles.DrawOutline(parentEntityIds, childEntityIds, parentColor, childColor);","handlingStrategy":"validation","validationCode":"// The [Obsolete(true)] attribute makes this a compile-time error.\n// Replace int[] overloads with EntityId[] overloads:\nEntityId[] parentIds = Array.ConvertAll(parentIntIds, id => (EntityId)id);\nEntityId[] childIds = Array.ConvertAll(childIntIds, id => (EntityId)id);\nHandles.DrawOutline(parentIds, childIds, parentColor, childColor);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["After Unity upgrades, grep for DrawOutline calls with int[] arguments and migrate to EntityId[].","Prefer the Renderer[] overloads which handle EntityId conversion internally."],"tags":["obsolete","api-migration","selection-outline","entity-id","unity-editor"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}