Skip to content

Unity 6000.5 compile error: DataVisualizer uses Object.GetInstanceID() #12

Description

@wallstop

Description

com.wallstop-studios.data-visualizer@0.0.35-rc05.6 still calls Object.GetInstanceID() in editor code. In Unity 6000.5, this obsolete InstanceID API is a compile error and should be migrated to EntityId.

Affected source in the published package:

Editor/DataVisualizer/DataVisualizer.cs:5890
name = $"object-item-row-{dataObject.GetInstanceID()}",

Why this is a problem

Unity 6000.5 replaces 32-bit InstanceID-based object identity with EntityId. The Unity 6000.5 upgrade path makes obsolete integer InstanceID APIs such as Object.GetInstanceID() fail compilation instead of only warning.

This blocks projects from compiling after upgrading to Unity 6000.5.2f1 while using the current next package version 0.0.35-rc05.6.

Unity references:

Steps to reproduce

  1. Open a Unity 6000.5.2f1 project.
  2. Install or resolve com.wallstop-studios.data-visualizer@0.0.35-rc05.6 from npm/UPM.
  3. Trigger script compilation.
  4. Observe the compile error at Editor/DataVisualizer/DataVisualizer.cs:5890 for Object.GetInstanceID().

Expected behavior

The package should compile under Unity 6000.5 without using removed/obsolete InstanceID APIs on active compile paths.

Actual behavior

Unity reports CS0619 for Object.GetInstanceID() in DataVisualizer.cs, preventing script compilation.

Suggested fix

Use EntityId on Unity versions where it is available, preserving the legacy fallback for older Unity versions. For example:

#if UNITY_6000_3_OR_NEWER
name = $"object-item-row-{EntityId.ToULong(dataObject.GetEntityId())}";
#else
name = $"object-item-row-{dataObject.GetInstanceID()}";
#endif

If the row name only needs to be unique for UI Toolkit and does not require numeric compatibility, another option is to convert the EntityId to a stable string representation in the Unity 6000.3+ branch.

Environment

  • Unity: 6000.5.2f1
  • Package: com.wallstop-studios.data-visualizer@0.0.35-rc05.6
  • Platform observed: Windows editor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions