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
- Open a project with Unity 6000.5.5f1.
- Install
com.microsoft.mrtk.graphicstools.unity 0.8.1.
- Allow Unity to compile the package.
- 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:
Describe the bug
Graphics Tools 0.8.1 does not compile with Unity 6000.5 because Unity changed
UnityEngine.Object.GetInstanceID()and theAssetDatabase.TryGetGUIDAndLocalFileIdentifier(int, ...)overload from obsolete warnings to obsolete errors.This blocks Editor compilation before entering Play Mode or building the project.
To reproduce
com.microsoft.mrtk.graphicstools.unity0.8.1.Actual behavior
Affected code:
Expected behavior
Graphics Tools should compile on Unity 6000.5 using the
EntityIdAPIs 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
EntityIdis unavailable.Screenshots
Unity Console reports the three CS0619 errors above during package compilation.
Your setup
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: