Replies: 11 comments 1 reply
-
Hi Lorenzo, it should work (but I didn’t test 😁). Could you provide a build log (in normal verbosity)? Pascal |
Beta Was this translation helpful? Give feedback.
-
Ok so the difficulty here (aside from my complete lack of understanding on this sort of thing) is that I believe Unity uses its own proprietary compiler, and I would imagine that the build process is not a conventional one (at least from my perspective, as it doesn't at all involve me manually instructing my IDE to build the project/solution). The best I could find so far is the Unity Editor log, which I captured after Unity compiled my assembly: Asset Pipeline Refresh: Total: 0.018 seconds - Initiated by RefreshV2(AllowForceSynchronousImport)
|
Beta Was this translation helpful? Give feedback.
-
Right, if that is a non-standard build, things will be complicated. |
Beta Was this translation helpful? Give feedback.
-
Ah I see. When you say post-build step, is it good enough if I invoke MrAdvice after Unity notifies me that scripts have recompiled, or does it need to be at a specific (earlier) time? |
Beta Was this translation helpful? Give feedback.
-
Any time after the assembly is generated is good enough. |
Beta Was this translation helpful? Give feedback.
-
Nice! I do have nuget hooked up with Unity, but I assume the best (only) way would be to call it through the command line like in your docs. If this is the case, which parameters must I include? Assembly path seems necessary, but I'm afraid I don't really know what the others refer to, and thus if they're necessary or not. |
Beta Was this translation helpful? Give feedback.
-
Getting close.. Again just not sure of which other parameters to include and what exactly they refer to, sorry! ///////net461 |
Beta Was this translation helpful? Give feedback.
-
Nevermind, I was just missing the referencepath parameter it seems! Magnificent. Will report back if I run into any further issues :) |
Beta Was this translation helpful? Give feedback.
-
Ok, so I can confirm that it does indeed work.. to an extent :P It appears that invoking MrAdvice whenever I want is not sufficient to apply the changes. Rather, I need to invoke MrAdvice and then force a recompile of scripts. I have tried all sorts of Unity callbacks to get my desired behaviour of hooking into the compilation process at the right time so I don't have to manually recompile, but to no avail so far. As a result, the only process that works is: Make changes to code in the assembly -> Wait for Unity to recompile -> Invoke MrAdvice -> Make Unity recompile again As a secondary issue, I was hoping that I could use a method advice aspect to debug a message after an IEnumerator method (coroutine) has finished, but I understand that there may be some complexities there due to how Unity handles such methods. A message before execution worked no problem. Finally, I was hoping to apply a method advice aspect to an abstract parent method and have it propagated to child classes, but this did not seem to work. Phew, that's all for now! |
Beta Was this translation helpful? Give feedback.
-
Hey again! I'm wondering if you have had/do have any time to explore this further. As explained above, I had gotten really close to having it work before, save for those few lingering issues. I wish I could dive into it more, but I just don't have the time (nor brainpower). Thanks! |
Beta Was this translation helpful? Give feedback.
-
I don’t work with Unity3D, so it’s hard for me to implement it. |
Beta Was this translation helpful? Give feedback.
-
Hi there!
I am just now learning about weaving and aspects and such, so forgive me. Is there any way I can get this to work with Unity (the game engine)? I can add the nuget package just fine, and have no compiler errors, but when I try to copy the sample aspect and call a decorated method, the advise method never fires.
Cheers,
Lorenzo
Beta Was this translation helpful? Give feedback.
All reactions