Skip to content

Unity 6.5 compatibility: Object.GetInstanceID() causes compilation errors #45

Description

@mingos

Summary

UnityScreenNavigator does not compile on Unity 6.5 because it uses Object.GetInstanceID().

GetInstanceID() was marked as obsolete in Unity 6.4 and causes compilation errors in Unity 6.5.

Environment

  • Unity 6.3: Works
  • Unity 6.4: Works (obsolete warning)
  • Unity 6.5: Compilation error

Cause

The following classes use Object.GetInstanceID() as the key for instance caches:

  • PageContainer
  • ModalContainer
  • SheetContainer

In Unity 6.5, GetInstanceID() should be replaced with GetEntityId(), and the dictionary key type should be changed from int to EntityId.

Additional information

I have already verified this change in my fork, and UnityScreenNavigator compiles and works correctly on Unity 6.5 after updating these classes.

A pull request with this fix will follow shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions