Hi Chris,
I understand that Unity 6000.6 may not have been officially tested or supported by Adventure Creator yet, but we tried upgrading our project and found a small compatibility issue that I wanted to report early.
After opening the project in Unity 6000.6, compilation failed with these two errors:
Assets/AdventureCreator/Scripts/ActionList/Editor/HierarchyIcons.cs(165,24):
error CS0619: 'EntityId.implicit operator EntityId(int)' is obsolete:
'EntityId will not be representable by an int in the future.
This casting operator will be removed in a future version.'
Assets/AdventureCreator/Scripts/ActionList/Editor/HierarchyIcons.cs(187,22):
error CS0619: 'EntityId.implicit operator EntityId(int)' is obsolete:
'EntityId will not be representable by an int in the future.
This casting operator will be removed in a future version.'
Under UNITY_6000_5_OR_NEWER, actionListIDs and rememberIDs are declared as:
HashSet<EntityId>
However, GatherIDs() still adds values returned by:
UnityVersionHandler.GetInstanceID(gameObject)
This returns an int, so the code relies on the implicit int -> EntityId conversion. In Unity 6000.6 that conversion is now marked as an error instead of a warning.
We fixed it by using GameObject.GetEntityId() directly for Unity 6000.5 and newer, while keeping the existing path for older Unity versions:
#if UNITY_6000_5_OR_NEWER
actionListIDs.Add(actionList.gameObject.GetEntityId());
#else
actionListIDs.Add(UnityVersionHandler.GetInstanceID(actionList.gameObject));
#endif
And similarly for rememberIDs:
#if UNITY_6000_5_OR_NEWER
rememberIDs.Add(constantID.gameObject.GetEntityId());
#else
rememberIDs.Add(UnityVersionHandler.GetInstanceID(constantID.gameObject));
#endif
This is also consistent with the existing comparisons later in HierarchyItemCB(), which already use gameObject.GetEntityId() under UNITY_6000_5_OR_NEWER.
After applying these two changes, the Adventure Creator-related compilation errors were resolved successfully in Unity 6000.6.0f1.
I hope this compatibility fix can be included in a future Adventure Creator update.
Thanks!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Yes indeed - thanks for the feedback.
I’ve just received the update and can confirm everything is working well now. Thanks a lot for the quick fix!