A custom Unity
property drawer designed to optimize the inspector view for Vector4
fields.
It reduces the space taken by the default layout, offering a cleaner, more compact design without sacrificing
functionality.
- Compact Layout: Displays
Vector4
fields in a condensed format, optimizing space in the inspector - Prefab Support: Correctly handles prefab instances and variants, ensuring changes are tracked and displayed properly with the ability to apply/revert changes
- No Configuration Required: Automatically applies to all
Vector4
fields without requiring any additional setup or custom inspectors/attributes - Inspector Modes Handling: Adapts seamlessly to both wide and compact inspector modes,
ensuring a consistent experience - Custom Inspectors Support: Fully compatible with custom inspectors, allowing effortless integration into existing editor workflows
You can install the Vector4 Compact Drawer
package using one of the following methods:
- Open
Unity
, then go toWindow -> Package Manager
. - Click on the dropdown and select
Add package from git URL...
- Paste the following
URL
and clickAdd
:
https://github.com/danliukuri/Vector4CompactDrawer.git?path=Vector4CompactDrawer.Unity/Assets/Plugins/Vector4CompactDrawer
- Go to the Releases Page.
- Download the desired package(s):
- Core package:
Vector4CompactDrawer@vX.X.X.unitypackage
- Samples (optional):
Vector4CompactDrawer.Samples@vX.X.X.unitypackage
- Core package:
- Import the package(s) into your
Unity
project.
Once installed, the Vector4 Compact Drawer
will automatically apply to all Vector4
fields in your scripts.
No additional configuration is required.
See the Showcase sample for simple usage demonstration.
To demonstrate the capabilities of the Vector4 Compact Drawer
, following samples have been created.
To see the compact drawer in action, simple Vector4
serialized field exposing script was created:
public class Vector4Exposer : MonoBehaviour
{
[SerializeField] private Vector4 serializedVector;
}
When you select a GameObject
with this component,
the Vector4
field will be displayed in a compact layout in the Unity Inspector
.
The drawer fully supports prefab instances and variants, ensuring changes are tracked and displayed correctly.
The drawer automatically adjusts based on the inspector's width
(EditorGUIUtility.wideMode
),
ensuring a consistent user experience across different layouts:
-
Wide Mode: The drawer displays the
Vector4
field in a single-line layout: -
Compact Mode: The field is split across two lines to maintain readability while conserving space:
Feel free to submit issues or pull requests to improve this package.