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

Abierto
#245 0 comentarios 4 reacciones 2 asignados Ver en GitHub

@Cameron-Micka ya está trabajando en esto.

Desde el 1/9/2026.

  • #246 de @copilot-swe-agent — cerrado sin fusionar

Evaluación

Este issue todavía no se ha evaluado.

Descripción

enhancement

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:

Lenguaje dominante
C#
Estrellas
209
Forks
49
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/MixedReality-GraphicsTools-Unity

Todos los issues de microsoft/MixedReality-GraphicsTools-Unity

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.