Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Drag-reordering actions changing IDs (case 1231233). #1118

Merged
merged 5 commits into from
Apr 14, 2020

Conversation

Rene-Damm
Copy link
Contributor

@Rene-Damm Rene-Damm commented Apr 4, 2020

Fixes 1231233 (Issue Tracker).

My initial fix was to explicitly clear out cached GUIDs in InputActionMap.OnAfterDeserialize. However, I decided that a better course of action is probably to do away with the cached GUIDs altogether so I removed them from InputActionMap, InputAction, and InputBinding.

This means that every id getter of these will now parse GUIDs on the fly (which, if everything goes well, will not allocate). However, non-string GUIDs are rarely used and for the most part, not used at all internally within the system. So, think this is the better setup. Also saves 16 bytes on an already massive InputBinding struct...

//NOTE: The fact we even have the problem is because we can't serialize Guids with Unity and because our own GUID struct (which is in fact serializable) is editor-only.

@Rene-Damm Rene-Damm requested a review from karljj1 April 4, 2020 09:33
@Rene-Damm Rene-Damm merged commit 585047c into develop Apr 14, 2020
@Rene-Damm Rene-Damm deleted the fix-action-guids-changing branch April 14, 2020 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants