Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

update from CompilerServices.Unsafe to Unsafe.UnsafeUtility #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mattmanj17
Copy link

fixes build break in issue #28

@draganvxx
Copy link

draganvxx commented Aug 8, 2022

@mattmanj17 when can we expect this to be merged and updated in the unity package manager? a few of us are running into the errors that this fixes and are just wondering

We're trying to replicate your changes manually but the scripts keep opening as miscellaneous files and wont allow us to add the using Unity.Collections.LowLevel.Unsafe; reference

@mattmanj17
Copy link
Author

@draganvxx I am not actively a part of the maintainers of this repo. I downloaded it the other day to play around with, and fixed this break locally when I ran into it. The change was straightforward enough that I thought I would submit a PR.

Whether or not this gets merged (or when) depends on what the owners do.

@draganvxx
Copy link

@mattmanj17 how did you go about fixing it locally? appreciate the response

@mattmanj17
Copy link
Author

@mathsteck commented on the original issue that "Unity moved the Unsafe to UnsafeUtility from Unity 2020 onwards", and that was enough of a hint to get started. I mostly just switched to the new class name, and then fixed some particular ones by hand that did not have the same name in the new class.

The changes in the PR are exactly everything I did locally to get it to work.

@draganvxx
Copy link

Gotcha makes sense. I'm dealing with some issue where I can't reference Unity to add the "using Unity.Collections.LowLevel.Unsafe;" reference within the script, it keeps opening as a miscellaneous file and isn't making the connection to the game engine or something. Thanks again for the tips & fix

@Renardjojo
Copy link

Package doesn't work for me without this pull request. (I am running with 2021.3.11f1)
Thank you @mattmanj17

@lucasrumney94
Copy link

lucasrumney94 commented Nov 17, 2022

Love this - thanks @mattmanj17 for taking the time to fix it.

For other people running into this issue, a good solution is to specifically import DearIMGui as a git repo in the package manager with this commit hash specified. I will write out the steps below, that I took to get Matt's cool changes!

Steps

Follow the README instructions to import the package in the package manager as a .git repo, but instead put this commit's hash after like this:
https://github.com/realgamessoftware/dear-imgui-unity.git#101996d5fced0e6601279e89cb753c474343e8aa

Import, and now all the compiler errors should have gone away

Next, depending on URP or not, follow the other useful issue chat in this repo that clarify that setup (#6)

Reference

https://docs.unity3d.com/Manual/upm-git.html#revision

NB

I was attempting to get this to work with OVR, doesn't seem to show up at all. Just a note to the next person!

@Polyethyleneglykol
Copy link

Love this - thanks @mattmanj17 for taking the time to fix it.

For other people running into this issue, a good solution is to specifically import DearIMGui as a git repo in the package manager with this commit hash specified. I will write out the steps below, that I took to get Matt's cool changes!

Steps

Follow the README instructions to import the package in the package manager as a .git repo, but instead put this commit's hash after like this: https://github.com/realgamessoftware/dear-imgui-unity.git#101996d5fced0e6601279e89cb753c474343e8aa

Import, and now all the compiler errors should have gone away

Next, depending on URP or not, follow the other useful issue chat in this repo that clarify that setup (#6)

Reference

https://docs.unity3d.com/Manual/upm-git.html#revision

NB

I was attempting to get this to work with OVR, doesn't seem to show up at all. Just a note to the next person!

That works perfectly, but I have an issue with the In-Engine Gizmos not rendering when Imgui is rendering, any fixes for that you can share?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants