Describe the bug
The latest stable MRTK packages do not compile with Unity 6000.5 because Unity changed UnityEngine.Object.GetInstanceID() from an obsolete warning to an obsolete error.
Confirmed affected packages:
org.mixedrealitytoolkit.input 3.3.0
org.mixedrealitytoolkit.spatialmanipulation 3.4.0
The same calls are also present in Input 4.0.0-pre.2 and the current main branch.
This blocks Editor compilation before entering Play Mode or building the project.
To reproduce
- Open a project with Unity 6000.5.5f1.
- Install MRTK Input 3.3.0 and Spatial Manipulation 3.4.0.
- Allow Unity to compile the packages.
- Observe the CS0619 errors.
Actual behavior
Spatial Manipulation 3.4.0:
Editor/Constraints/ConstraintManagerEditor.cs(291,66): error CS0619: 'Object.GetInstanceID()' is obsolete: 'GetInstanceID is deprecated. Use GetEntityId instead. This will be removed in a future version.'
Editor/Constraints/ConstraintManagerEditor.cs(373,76): error CS0619: 'Object.GetInstanceID()' is obsolete: 'GetInstanceID is deprecated. Use GetEntityId instead. This will be removed in a future version.'
Input 3.3.0:
Editor/Inspectors/InteractionModeManagerEditor.cs(91,25): error CS0619: 'Object.GetInstanceID()' is obsolete: 'GetInstanceID is deprecated. Use GetEntityId instead. This will be removed in a future version.'
Affected patterns include:
constraintManager.GetInstanceID()
selectedConstraintManager.GetInstanceID()
HashSet<int> seenInstanceIDs = new HashSet<int>();
int instanceID = key.objectReferenceValue.GetInstanceID();
Expected behavior
MRTK should compile on Unity 6000.5 using EntityId while retaining compatibility with the packages' older supported Unity versions.
For example, the duplicate mapping logic can use HashSet<EntityId>, GetEntityId(), and EntityId.None on supported Unity versions. Conditional compilation or a compatibility helper may be needed because the packages currently support Unity versions where EntityId is unavailable.
Screenshots
Unity Console reports the CS0619 errors above during package compilation.
Your setup
- Unity Version: 6000.5.5f1
- MRTK Input: 3.3.0
- MRTK Spatial Manipulation: 3.4.0
- 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
Describe the bug
The latest stable MRTK packages do not compile with Unity 6000.5 because Unity changed
UnityEngine.Object.GetInstanceID()from an obsolete warning to an obsolete error.Confirmed affected packages:
org.mixedrealitytoolkit.input3.3.0org.mixedrealitytoolkit.spatialmanipulation3.4.0The same calls are also present in Input 4.0.0-pre.2 and the current
mainbranch.This blocks Editor compilation before entering Play Mode or building the project.
To reproduce
Actual behavior
Spatial Manipulation 3.4.0:
Input 3.3.0:
Affected patterns include:
Expected behavior
MRTK should compile on Unity 6000.5 using
EntityIdwhile retaining compatibility with the packages' older supported Unity versions.For example, the duplicate mapping logic can use
HashSet<EntityId>,GetEntityId(), andEntityId.Noneon supported Unity versions. Conditional compilation or a compatibility helper may be needed because the packages currently support Unity versions whereEntityIdis unavailable.Screenshots
Unity Console reports the 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
mainbranch also contain the same call.