|
Post by PixelEnvision on May 13, 2019 14:05:08 GMT
Hi,
Would it possible to make MA's Physics dependency optional?
I'm working on a 2d game and I'm trying to optimize game size by disabling unused Unity packages in Package Manager.
Even though I'm not using any of them, disabling Physics package causes compile errors in some of the scripts ListenerFollower, TransformFollower, EventSounds, FootstepSounds & AmbientUtil.
I'm currently opted-in to keeping the Physics but I thought I should ask...
Thanks!
|
|
|
Post by DarkTonic Dev on May 13, 2019 16:11:57 GMT
I was not aware you could disable physics entirely and cause compilation errors. How exactly do you do that? Do you know what Unity version first added this capability?
|
|
|
Post by PixelEnvision on May 13, 2019 16:57:04 GMT
Yeah, apparently it's available since 2017.2 Unity Package Manager Overview
It's at Window => Package Manager, from there you can select "Built-in Packages" and disable them too... This is how my projects looks right now:
|
|
|
Post by DarkTonic Dev on May 13, 2019 17:10:02 GMT
Thanks! If that's the case, why are we only worried about Physics? Is that just the most likely one to be turned off? I bet there are others, which if disabled will cause compilation errors as well.
Anyway, I will need to see if there's a way to detect which packages have been disabled programmatically. That's what it will require if this can be fixed. Will report back.
|
|
|
Post by PixelEnvision on May 13, 2019 17:14:16 GMT
You're welcome. Well, for me it's the size..
Physics package is one of the larger ones and it would be nice to be able to disable it. And for most of the 2d games that might be the case as you'll probably use Physics 2d instead.
|
|
|
Post by DarkTonic Dev on May 13, 2019 19:22:23 GMT
|
|
|
Post by PixelEnvision on May 13, 2019 20:49:11 GMT
Thanks for sharing, that looks promising. I hope it turns out doable.
|
|
|
Post by DarkTonic Dev on May 13, 2019 21:46:24 GMT
Hopefully.
|
|
|
Post by DarkTonic Dev on Jun 14, 2019 0:03:25 GMT
What version of Unity are you on? Because the thing that makes this possible only exists in Unity 2019. I'm not going to spend time seeing if it works if you're stuck on an older version of Unity and can't benefit from it. I would go about it a different way if you're on an older version.
|
|
|
Post by PixelEnvision on Jun 14, 2019 0:34:40 GMT
Hey, thanks for the follow-up. I'm on latest tech release, 2019.1.6f1
|
|
|
Post by DarkTonic Dev on Jun 14, 2019 4:58:07 GMT
Thanks, I'll try and fix it one way or the other. It will probably take a couple weeks to cover all the bases unfortunately.
|
|
|
Post by PixelEnvision on Jun 14, 2019 8:49:15 GMT
Sure, that's not something urgent and thanks for even considering doing it...
|
|
|
Post by DarkTonic Dev on Jun 14, 2019 14:27:15 GMT
Sure, that's not something urgent and thanks for even considering doing it... I think it's a good idea that strictly 2D Games should be able to run this plug-in albeit with less features.
|
|
|
Post by DarkTonic Dev on Jul 25, 2019 20:09:54 GMT
I've finished this and plan on releasing an update tomorrow. It does require you add a define for each of the physics packages you haven't installed in the Project Settings dialog, and there was no way around that, since the asmdef feature for this doesn't work. The documentation on how to do this is already up: www.dtdevtools.com/docs/masteraudio/Physics.htmIf you don't have Physics3D, you will lose Ambient Sound feature as it won't work. If you want Occlusion to work, you must have either 3D or 2D, and Event Sounds will not show the events for the packages you've not installed.
|
|
|
Post by PixelEnvision on Jul 26, 2019 13:33:08 GMT
I've finished this and plan on releasing an update tomorrow. It does require you add a define for each of the physics packages you haven't installed in the Project Settings dialog, and there was no way around that, since the asmdef feature for this doesn't work. The documentation on how to do this is already up: www.dtdevtools.com/docs/masteraudio/Physics.htmIf you don't have Physics3D, you will lose Ambient Sound feature as it won't work. If you want Occlusion to work, you must have either 3D or 2D, and Event Sounds will not show the events for the packages you've not installed. That sounds perfect, thank you very much! I'll test it let you know as soon as I can when the update is out...
|
|