GUID Component

Hello Community!

I’ve done tiny library for GUID-based cross-scene references.
For those who never meet such a solution:

It allows to add component with unique id to GameObjects and when at runtime find those objects by their ids regardless the objects scene.

Despite Unity Technologies already has such a tool in their repository it looks a little bit abandoned.
So I decided to implement another one focusing on friendly UX and unity-like UI.

The main advantage of my implementations:

  • Robust GUID generation which respect object duplication (Ctrl+D) and totally ignore component Reset and prefab Revert.
    So with this tool it’s much more hard to lose generated GUIDs.

  • PropertyDrawer for GUIDReference made as close to ObjectField as possible.
    It supports object ping in hierarchy (or container scene if object isn’t loaded)

  • There are extra context menu which allows additively load/unload scenes with target object.

So it’s nothing special but hight integrated package.
And I’m glad to share it with you and appreciate any suggestion / bugreports.

Repository
https://github.com/maligan/unity-guid

Screen

2 Likes

Nice work! Interesting trick, using editor instance id to detect if it’s been duplicated - I may use that :slight_smile:

The object reference editor ui also looks slick - looks exactly like a scene reference, very clever

I come from the ECS world and was looking for a cross-scene reference solution that could be repurposed to solve a common problem in ECS of linking scene GameObjects to subscene entities. I’ve tried a few other solutions in the past without success. A couple of weeks ago, I started trying to get this one to work, and while I had to modify a few things, I was successfully able to use this as a base for a working linking mechanism! The GUIDs are very robust, and the workflow is very intuitive.

Just wanted to say thank you for making this and sharing it!

1 Like