microsoft / microsoft/MixedReality-GraphicsTools-Unity

[Bug] Unity 6000.5 compilation fails on GetInstanceID and int AssetDatabase APIs

Open
#245 0 comments 4 reactions 2 assignees View on GitHub

@Cameron-Micka is already working on this.

Since Sep 1, 2026.

  • #246 by @copilot-swe-agent — closed without merging
enhancement
Dominant language
C#
Stars
209
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

Graphics Tools 0.8.1 does not compile with Unity 6000.5 because Unity changed UnityEngine.Object.GetInstanceID() and the AssetDatabase.TryGetGUIDAndLocalFileIdentifier(int, ...) overload from obsolete warnings to obsolete errors.

This blocks Editor compilation before entering Play Mode or building the project.

To reproduce

  1. Open a project with Unity 6000.5.5f1.
  2. Install com.microsoft.mrtk.graphicstools.unity 0.8.1.
  3. Allow Unity to compile the package.
  4. Observe the CS0619 errors.

Actual behavior

Runtime/MeshCombiner/MeshUtility.cs(308,115): error CS0619: 'Object.GetInstanceID()' is obsolete: 'GetInstanceID is deprecated. Use GetEntityId instead. This will be removed in a future version.'
Runtime/Utilities/MaterialRestorer.cs(75,76): error CS0619: 'Object.GetInstanceID()' is obsolete: 'GetInstanceID is deprecated. Use GetEntityId instead. This will be removed in a future version.'
Runtime/Utilities/MaterialRestorer.cs(75,29): error CS0619: 'AssetDatabase.TryGetGUIDAndLocalFileIdentifier(int, out string, out long)' is obsolete: 'Please use TryGetGUIDAndLocalFileIdentifier(EntityId, out string, out long) with the EntityId type instead.'

Affected code:

// MeshUtility.cs
public int MeshFilterID;
// ...
MeshFilterID = meshFilter.GetInstanceID();

// MaterialRestorer.cs
AssetDatabase.TryGetGUIDAndLocalFileIdentifier(
    material.GetInstanceID(), out string guid, out long _);

Expected behavior

Graphics Tools should compile on Unity 6000.5 using the EntityId APIs while retaining compatibility with the package's older supported Unity versions.

A conditional compatibility path may be needed because the package currently supports Unity 2021.3, where EntityId is unavailable.

Screenshots

Unity Console reports the three CS0619 errors above during package compilation.

Your setup

  • Unity Version: 6000.5.5f1
  • Graphics Tools Version: 0.8.1
  • Editor OS: macOS
  • Regression check: Unity 6000.4.6f1 reports GetInstanceID() as an obsolete warning; Unity 6000.5.5f1 reports it as an obsolete error.

Target platform

Editor compilation issue; platform-independent. Observed in an iOS/OpenXR project.

Additional context

The same Unity 6000.5 API transition also affects MRTK Input and Spatial Manipulation:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.