alttester / alttester/AltTester-Unity-SDK
Unity 6000.5: SDK does not compile — Object.GetInstanceID() is obsolete (CS0619)
- Dominant language
- C#
- Stars
- 121
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
**In what language is the test written?**
C#
**What version of Unity are you using?**
6000.5.9f1 (Unity 6.5). Unity 6000.4.x is affected as warnings only.
**What version of AltTester® Unity SDK are you using?**
2.3.2, and `development` @ 918ad5ac
**On what device are you trying to run the test?**
Not device-specific — the package does not compile at all, in the Editor or for any target.
**The OS from where you are running the test?**
Windows
### Summary
On Unity 6000.5 the SDK does not compile, so no project with the package installed can enter Play mode or produce an instrumented build.
Unity 6000.4 deprecated `Object.GetInstanceID()` in favour of `Object.GetEntityId()`; 6000.5 escalated that deprecation to an error. The 19 call sites in the runtime assembly now raise CS0619 and `AltTester.AltTesterUnitySDK.dll` never builds.
Two things make this more than a rename:
1. `#pragma warning disable CS0619` does **not** suppress an obsolete-as-error, so there is no consumer-side workaround. The package has to change.
2. `EntityId`'s implicit conversion to `int` is deprecated as an error too, so `int id = obj.GetEntityId();` does not compile either. The supported way to reach the numeric value is `EntityId.ToULong(EntityId)` — `EntityId.GetRawData()` is itself deprecated in favour of it.
`EntityId.ToULong` and the no-argument `FindObjectsByType()` overload both first appear in **6000.4**, so a `UNITY_6000_4_OR_NEWER` gate keeps 2021.3–6000.3 on the current code paths.
### Steps to reproduce
1. Open or create a Unity 6000.5.9f1 project.
2. Install `com.alttester.sdk` 2.3.2.
3. Let the project compile.
### Relevant logs and/or screenshots
19 errors, all CS0619, across 6 files:
```
Runtime/Commands/AltRunner.cs(100,32): error CS0619: 'Object.GetInstanceID()' is obsolete: 'Use GetEntityId instead.'
Runtime/Commands/AltRunner.cs(109,82): error CS0619: ...
Runtime/Commands/AltRunner.cs(113,21): error CS0619: ...
Runtime/Commands/AltRunner.cs(134,30): error CS0619: ...
Runtime/Commands/AltRunner.cs(213,82): error CS0619: ...
Runtime/Commands/AltRunner.cs(217,21): error CS0619: ...
Runtime/Commands/AltRunner.cs(220,30): error CS0619: ...
Runtime/Commands/AltRunner.cs(251,21): error CS0619: ...
Runtime/Commands/AltRunner.cs(263,21): error CS0619: ...
Runtime/Commands/FindObject/AltBaseFindObjectsCommand.cs(117,102) and (117,134)
Runtime/Commands/FindObject/OldFindObject/AltOldBaseFindObjetsCommand.cs(125,106) and (125,138)
Runtime/Commands/FindObject/OldFindObject/PathSelector.cs(125,88), (187,32), (275,40)
Runtime/Commands/FindObject/SelectorConditionController.cs(63,36), (126,44)
Runtime/Input/FindObjectViaRayCast.cs(140,28)
```
Alongside these, 6000.5 also turns five call sites into CS0618 deprecation warnings:
```
Runtime/Commands/AltRunner.cs(142,40): warning CS0618: 'Object.FindObjectsOfType()' is obsolete
Runtime/Commands/FindObject/AltGetAllCamerasCommand.cs(41,27): warning CS0618: 'Object.FindObjectsByType(FindObjectsSortMode)' is obsolete
Runtime/Commands/FindObject/AltGetAllCamerasCommand.cs(41,60): warning CS0618: 'FindObjectsSortMode' is obsolete
Editor/Scripts/AltTesterEditor/AltTesterEditorWindow.cs(201,50): warning CS0618: 'PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup)' is obsolete
Editor/Scripts/CreateAltPrefab.cs(1282,50): warning CS0618: 'PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup)' is obsolete
```
These are the same class of problem as #1921, which did not cover them.
Contributor guide
Assessment
This issue has not been assessed yet.