// draw content box background, outline and selection/unexplored aura public static void DrawBoxAndBackground(Rect contentRect, EntityDrawContext context ) { Rect outlineRect = contentRect.AddBorder( 1 ); // selected items get highlighted if ( context.isSelected ) { var auraRect = outlineRect.AddBorder( context.style.highlightStrength ); EditorGUI.DrawRect( auraRect, context.style.highlightColor ); } else if ( context.isUnexlored ) { var auraRect = outlineRect.AddBorder( context.style.highlightStrength ); EditorGUI.DrawRect( auraRect, context.style.unexploredColor ); } else { // draw shadow EditorGUI.DrawRect( outlineRect.Move( shadowOffset ), context.style.shadowColor ); } // draw outline rect EditorGUI.DrawRect( outlineRect, Color.black ); // draw content rect EditorGUI.DrawRect( contentRect, context.isTarget ? context.style.targetBackgroundColor : context.style.backgroundColor ); }