Object Reference Manager

A persistent GameObject reference palette with automatic prefab variant creation
for the Unity Editor by BigBuffaloBill.

Overview home

Author's Note on Expected Functionality: The author has written an important note about the intended scope, known limitations, and support expectations for this toolset. Please see Notes on Tool Intent, Status and Author Support before proceeding.

Object Reference Manager is a Unity Editor extension that gives you a dedicated window for storing, organizing, and reusing GameObject references across your project. Instead of hunting through deep folder hierarchies or losing track of frequently used assets, you can keep them all in one dockable panel — complete with 64×64 thumbnail previews — and drag them directly into your scenes.

What sets Object Reference Manager apart is its automatic prefab variant workflow. When you drag a scene object into the manager, it detects that the object is not yet a persistent asset and automatically creates a prefab variant in a dedicated Prefabs subfolder. This means you never accidentally store a reference to a transient scene object that would break the next time you reload. Every reference in the manager is guaranteed to point to a real, saved asset.

The tool stores all its data in a single ScriptableObject asset, so your reference list persists across Editor sessions, domain reloads, and even source control operations. It uses self-resolving asset paths — the window locates its own data files at runtime based on where the script is installed, so it works regardless of where you place it in your project and is fully compatible with symlinks and custom folder structures.


Key Features home


Requirements home


Installation home

Typical Package Manager Installation

  1. After purchasing Object Reference Manager on the Unity Asset Store, click the Open in Unity button on the store page. This automatically opens the Package Manager window in your Unity Editor and navigates to My Assets with the package selected.
  2. In the package details panel, click Download to download the package to your machine. A progress bar will appear while the download completes.
  3. Once the download finishes, the button changes to Import. Click it to begin importing.
  4. The Import Unity Package dialog appears with all package contents pre-selected. Optionally uncheck any items you do not want to include, then click Import.
  5. The Package Manager places the imported files into your project’s Assets folder, where they are accessible from the Project window.

After Import

Allow Unity to compile the newly imported scripts. Once compilation finishes, the tool is ready to use — no additional setup is required. The following assets will be present in your project:

Assets/BBB/ObjectReferenceManager/
├── Editor/
│   └── ObjectReferenceManager.cs
├── ObjectReferences.cs
├── ObjectReferenceManagerData.asset   (created automatically if missing)
└── Prefabs/                           (created automatically on first use)

Note: The ObjectReferenceManagerData.asset file and the Prefabs/ folder are created automatically the first time you open the manager window. You do not need to create them manually.


Getting Started home

  1. Open the manager window: go to Tools > BBB > Object Reference Manager in the Unity menu bar.
  2. The window opens with an empty array. Enter a number in the size field next to the Resize Array button and click the button. A confirmation dialog will appear warning that resizing clears all current data — click Yes to proceed.
  3. Drag any GameObject from the Project window into one of the Object Reference fields. The asset is stored immediately.
  4. To store a scene object, drag it from the Hierarchy into a slot. The manager automatically creates a prefab variant in the Prefabs subfolder and stores a reference to the new prefab asset instead of the transient scene object.
  5. To use a stored object, drag its 64×64 thumbnail preview from the manager window into the Scene view or Hierarchy. The referenced prefab will be instantiated.
  6. Your references persist automatically — close and reopen Unity, and the manager window will show all the same objects.

Detailed Usage Guide home

Opening the Window

Navigate to Tools > BBB > Object Reference Manager in the Unity menu bar. The window is a standard dockable Editor window — you can dock it alongside the Inspector, Scene view, or any other panel. The window title is “Object Reference Manager.”

Managing Array Size

At the top of the window, you will find a Resize Array button and an integer input field.

  1. Enter the desired number of slots in the integer field.
  2. Click Resize Array.
  3. A warning dialog appears: “Resizing will clear all current data. Continue?” Click Yes to proceed or No to cancel.

Important: Resizing clears all existing references in the array. This is by design to prevent index confusion. If you need to preserve existing references, note them before resizing.

The minimum array size is 0. Negative values are automatically clamped to 0.

Adding Object References

Each array slot displays an element index label, a selection checkbox, a 64×64 thumbnail preview area, and a standard Unity ObjectField.

Adding project assets: Drag any GameObject prefab from the Project window into the ObjectField for a slot. The reference is stored directly.

Adding scene objects: Drag a GameObject from the Hierarchy into the ObjectField. The manager automatically:

  1. Detects that the object is not a persistent asset (using EditorUtility.IsPersistent).
  2. Creates a Prefabs subfolder if one does not already exist.
  3. Saves the scene object as a prefab asset using PrefabUtility.SaveAsPrefabAsset.
  4. Names the prefab <ObjectName>_Variant_<SlotIndex>.prefab (with automatic unique path generation to avoid naming collisions).
  5. Replaces the scene object reference with the new prefab asset reference.

This conversion happens automatically every GUI update cycle, so any scene object reference is converted as soon as it appears in the array.

Dragging Objects Out

Each slot displays a 64×64 thumbnail of the referenced asset (generated by Unity’s AssetPreview.GetAssetPreview). While the preview is loading, a “...” placeholder is shown. Empty slots display “Empty.”

To drag an object out of the manager:

  1. Left-click and hold on the thumbnail preview image.
  2. Drag beyond a 4-pixel threshold to initiate the drag operation.
  3. Drop the object into the Scene view, Hierarchy, or any other field that accepts GameObject references.

The drag operation uses Unity’s standard DragAndDrop API, so it is compatible with all standard Editor drop targets.

Selecting and Clearing References

Checkbox selection: Each row has a checkbox to the right of the element label. Check one or more rows to select them.

Clear Selected: Click the Clear Selected button to set all checked slots to null. The checkboxes are also cleared.

Clear All: Click the Clear All button to set every slot in the array to null and clear all checkboxes.

Right-click context menu: Right-click on any thumbnail preview to open a context menu. If the slot contains an object, the menu shows a Clear Object option that sets that slot to null. If the slot is empty, the option is grayed out.

Note: Clearing a reference removes it from the manager only. The underlying prefab asset in the Prefabs folder is not deleted.

Data Persistence

All references are stored in ObjectReferenceManagerData.asset, a ScriptableObject asset located in the same directory as the ObjectReferenceManager package. This file:

The manager marks the data asset as dirty on every GUI update, ensuring that changes are included in the next asset save operation.

Auto-Generated Prefab Variants

Prefab variants created by the manager are saved to a Prefabs/ subfolder within the package install directory. The naming convention is:

<OriginalObjectName>_Variant_<SlotIndex>.prefab

If a file with that name already exists, Unity’s AssetDatabase.GenerateUniqueAssetPath appends a numeric suffix to ensure uniqueness (e.g., Tree_Variant_0 1.prefab).

These prefab assets are standard Unity prefabs and can be used, moved, or deleted independently of the manager.


API Reference home

ObjectReferenceManager (class)

Namespace: Global (no namespace)

Inherits: UnityEditor.EditorWindow

Location: Editor/ObjectReferenceManager.cs

Description: The main Editor window class. This is an editor-only class and is not available at runtime.

Menu Items

Menu PathMethodDescription
Tools > BBB > Object Reference Manager ShowWindow() Opens or focuses the Object Reference Manager window.

Key Private Methods

These methods are not part of a public API but are documented here for reference and extensibility:

MethodDescription
OnEnable()Resolves asset paths from the script’s own location using MonoScript.FromScriptableObject, then loads or creates the data asset.
OnGUI()Draws the window GUI, applies serialized property changes, runs the scene-to-prefab conversion pass, and marks data dirty.
DrawCustomArrayField()Renders the resize controls, Clear Selected / Clear All buttons, and the per-element rows with checkboxes, thumbnails, and ObjectFields.
DrawDragIcon(int index)Renders the 64×64 thumbnail for a slot and handles left-click drag-out initiation, right-click context menus, and mouse state tracking.
ClearObjectAtIndex(int index)Sets data.gameObjects[index] to null and refreshes the serialized state.
ClearSelected()Nullifies all checked slots and clears their checkboxes.
ClearAll()Nullifies every slot and clears all checkboxes.
ResizeArrayWithWarning()Shows a confirmation dialog, then resizes and clears the array if the user confirms. Clamps negative sizes to 0.
ConvertSceneObjectsToPrefabs()Iterates the array and converts any non-persistent (scene) GameObjects into prefab assets via CreatePrefabVariant.
HandleDragAndDrop(Rect, int)Processes DragUpdated and DragPerform events for accepting external drag-and-drop into individual slots.
CreatePrefabVariant(GameObject, int)Creates the Prefabs directory if needed, generates a unique asset path, saves the scene object as a prefab via PrefabUtility.SaveAsPrefabAsset, and returns the new prefab asset.

ObjectReferences (class)

Namespace: Global (no namespace)

Inherits: UnityEngine.ScriptableObject

Location: ObjectReferences.cs

Description: A minimal ScriptableObject that holds the persistent array of GameObject references.

Public Fields

FieldTypeDefaultDescription
gameObjects GameObject[] new GameObject[0] The array of stored GameObject references. Each element can be null (empty slot) or a reference to a prefab or other persistent GameObject asset.

ObjectReferenceManagerData.asset

Type: Serialized ObjectReferences ScriptableObject

Location: Same directory as the package root (auto-created if missing)

Description: The persistent data store. This YAML-serialized asset contains the gameObjects array with Unity object references (fileID + GUID pairs). It can be version-controlled normally.


Tips and Best Practices home

Organize by purpose. Use separate array regions for different categories — for example, slots 0–9 for vegetation, 10–19 for props, 20–29 for UI elements. The element index labels make it easy to maintain a mental map.

Pre-size your array. Decide on a slot count before you start populating references. Resizing clears all data, so it’s better to allocate extra empty slots upfront than to resize later.

Use the thumbnails for dragging. The thumbnail preview area is the designated drag source. Click and drag from the thumbnail image to place objects in your scene. The ObjectField itself is for assigning references, not for dragging out.

Let the auto-conversion work for you. You don’t need to manually create prefabs before adding scene objects. Just drag objects from the Hierarchy and the manager handles prefab creation automatically. The generated prefabs appear in the Prefabs subfolder.

Version control the data asset. The ObjectReferenceManagerData.asset file and the Prefabs/ folder should be committed to your repository so that all team members share the same reference palette.

Relocate freely. Because the tool resolves its own paths at runtime, you can move the entire package folder to a different location in your project without breaking anything. Just let Unity reimport after moving.

Check debug logs for issues.


FAQ / Troubleshooting home

Q: I resized the array and lost all my references. Can I undo?

A: The resize operation shows a warning dialog before proceeding. If you confirmed the resize, the previous data is overwritten. Unity’s Undo system does not cover this operation. It is recommended to note your current references before resizing or to keep your data asset under version control so you can revert.

Q: The thumbnail shows “...” instead of a preview image.

A: Unity generates asset previews asynchronously. The “...” placeholder appears while the preview is loading. The preview will appear after a moment, or after the window is repainted. If it persists, try clicking away and back, or reimporting the asset.

Q: A slot shows “Empty” even though I dragged something in.

A: If you dragged a scene object and the prefab creation failed (for example, due to a write permission issue in the Prefabs folder), the slot may revert to null.

Q: Where are the auto-generated prefabs saved?

A: In a Prefabs/ subfolder within the Object Reference Manager’s install directory. For example, if the package is at Assets/BBB/ObjectReferenceManager/, the prefabs are at Assets/BBB/ObjectReferenceManager/Prefabs/.

Q: Can I delete the auto-generated prefabs?

A: Yes. They are standard Unity prefab assets. However, if the manager still references a deleted prefab, that slot will show a “Missing” reference. Clear the slot using the right-click context menu or the Clear buttons.

Q: I moved the package folder and the data is gone.

A: The data asset (ObjectReferenceManagerData.asset) must remain in the same directory as the package root. If you moved the folder, the data asset moved with it and the tool will find it at the new location on next open. If you moved only the Editor script without the data asset, the tool will create a new empty data asset. Move all files together to preserve data.

Q: Can I use this at runtime?

A: No. Object Reference Manager is an Editor-only tool. The ObjectReferenceManager class is in an Editor folder and depends on UnityEditor APIs that are not available in builds. The ObjectReferences ScriptableObject can technically be accessed at runtime, but the manager itself cannot.

Q: Does this work with Unity’s Addressables or asset bundles?

A: The manager stores direct object references (GUID-based). It does not integrate with Addressables or AssetBundle systems. You can still use the manager to organize your references, but the stored references are standard Unity asset references, not addressable keys.


Version History home

v1.0.0 — Initial Release


Support and Contact home

For questions, bug reports, or feature requests, please contact us through the Dicord Channel linked below.

Publisher: BigBuffaloBill

Discord: BigBuffaloBill & Friends Gaming + (bbb-unity-support-forum-public)