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

patching Coroutine methods #1

Open
friuns2 opened this issue Jul 18, 2017 · 5 comments
Open

patching Coroutine methods #1

friuns2 opened this issue Jul 18, 2017 · 5 comments

Comments

@friuns2
Copy link

friuns2 commented Jul 18, 2017

for example this method patching not work
IEnumerator cor()
{
Debug.Log("test4234");
yield return null;
}

is it hard to add support for corontinue methods?

@zapu
Copy link
Owner

zapu commented Jul 24, 2017

Oh hey, I completely missed this issue, for some reason Github chose not to e-mail me. No idea why.

Did you have much luck in any patching at all? I never managed to get this project into stable state, mainly because Unity lacks ability to add hooks to compilation process. I'm willing to go back and revisit it this year, though.

I'll keep coroutines in mind. If I remember correctly, when coroutine is compiled, a new class is created by the compiler that encapsulates the state machine and everything. So this feature might require having an ability to inject new types first.

@friuns2
Copy link
Author

friuns2 commented Jul 25, 2017

also i noticed its freezes for 5 seconds on big project after compilation, would be good if could pick which classes to patch instead everything

btw this project managed to patch corontinue methods but its memory patching https://github.com/pardeike/Harmony

@zapu
Copy link
Owner

zapu commented Jul 25, 2017

Does it work with Unity? I was researching some memory patching ideas at first but couldn't figure anything like this out, I'm clueless about mono internals.

@friuns2
Copy link
Author

friuns2 commented Jul 26, 2017

yes and its seems easy to do it, just couple hungred lines of code whole project, but don't know how he did found out. maybe he used dnspy

@zapu
Copy link
Owner

zapu commented Jun 24, 2018

FWIW there's a new version out that might be more stable. Definitely plays nicer with Unity because it does not need instrumentation to do patching.

Coroutines are still on the roadmap, though...

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

No branches or pull requests

2 participants