Conversation
Older versions still use instance IDs.
While some discussion on the Web implies that the generic TreeView classes exist in 6.2, our CI does not agree.
This reverts commit 2c29c7f. Try using TreeView generic classes in older versions of Unity.
|
This should be ready for review now. |
|
While running the built package I get the following error:
I believe this is because the preprocessor directive is handled when the package is built, so the code that's outputted is the code for the version of Unity we're building on CI with. I think this might mean we need to build a separate package for Unity 6.5+. I think it should be possible to distribute this through the package manager and have it handle the correct package for the correct unity version, though I'm not positive. |
Just to be sure, you're testing the built package in 6.5?
I guess this comes down to the meaning of "6.5 is supported" and whether we want to commit to that in this release. |
We can definitely try to build a separate package for 6.5 and release on GitHub. Sadly I don't think we can have two package versions with the same version number but intended for different Unity versions. We could try to host two versions, one that is For now, I think it's worth:
Is that a fair game plan? |
| #if UNITY_6000_2_OR_NEWER | ||
| using TreeViewItem = UnityEditor.IMGUI.Controls.TreeViewItem<int>; | ||
| using TreeViewState = UnityEditor.IMGUI.Controls.TreeViewState<int>; | ||
| #endif |
There was a problem hiding this comment.
Using a #if in a ConfigureReinterop file is never going to work properly. Or at least it will require separate native builds for the different versions. We really don't want to do that. For one thing, it will double the already horrendously long CI times.
It should be possible to solve this using inheritance instead. In a separate file, define a class CesiumTreeViewItem. Using a #if, make it inherit from either TreeViewItem or TreeViewItem<int> depending on the Unity version. Then use that class in this file instead of TreeViewItem.
If there are any methods of CesiumTreeViewItem where the signature changes as a result of the #if, you can't use them in ConfigureReinterop. Provide a common signature by wrapping them instead.
Description
Add support for Unity 6.5, while retaining compatibility with Unity 6.3. In Unity
instanceIDshave been replaced with an opaqueEntityIdwhich is actually a 64 bit integer. Our native code will use one or the other as appropriate.Additionally, the
TreeViewclasses now require templated versions, so their usage was updated.Issue number or link
#704
Author checklist
CHANGES.mdwith a short summary of my change (for user-facing changes).Remaining Tasks
Test with Unity 6.5 in GitHub CI?
Testing plan
Gave it a spin with Unity 6.3 and 6.5.
Reviewer checklist
Thank you for taking the time to review this PR. By approving a PR you are taking as much responsibility for these changes as the author.
As you review, please go through the checklist below:
CHANGES.mdto make sure they accurately cover the work in this PR.