-
-
Notifications
You must be signed in to change notification settings - Fork 416
Removing UnityEngine reference inside com.rlabrecque.steamworks.net.asmdef #630
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
base: master
Are you sure you want to change the base?
Conversation
…t.asmdef To improve compile times, I've removed the UnityEngine from the base of the plugin. The one reference was simply to pass along exception logging, so I've instead replaced it with a static delegate. In SteamManager.cs, you can hook into this delegate in OnEnable()/OnDisable().
|
Opened a pull request for the corresponding change for SteamManager.cs here: rlabrecque/Steamworks.NET-SteamManager#7 |
|
I like this A LOT; I wonder if it's possible to avoid breaking compatibility with this though as It's not really expected that people have to update or change their SteamManager (or equivalent). Might need to think on this one for a minute |
|
Ah, yeah.. I can see how that's a bit of a pain. It's too bad the SteamManager script itself isn't also in a package manager repo, so you could just have the packages in sync via dependencies. |
|
Yeah, though it's explicitly not just because it was originally just a place to start from as 'user code'. As the initial users each had unique ways of handling their 'managers', like some didn't have or want that type of code as a MonoBehavior aaat all. Being unopinionated here is the only reason why Steamworks.NET is still around at all. Trying to use Steamworks.NET via the package manager again this last week for the first time in a year or two was somewhat frustrating because of this though; so I was already having some thoughts about how we could ship SteamManager but with an option (somehow) to copy it into the users Scripts directory (and then also allow people to update their copy if they are using an untouched version). I'm not even quite sure how such an option would interact with this specific change too. Some other options we have:
|
|
Option 2 makes sense to me! Gives people ample time to eventually go to the callback system. I don't want to cause any issues with this pull request, I know how frustrating breaking changes can be. Having the ability to simply copy in the manager seems good too, although personally I never actually edit that file. I assumed we were meant to inherit from it, and then make any changes necessary. |
|
Maybe this code initially for option 2? Also Let's us get the SteamManager change in ASAP too. |
Unity Package Manager has a concept of "Samples" It is where you would put things like that That said SteamManager.cs as it is I think should be looked at a bit. What we do with our samples to drive home that its a sample for learning and not production marks them Obsolete And or you could brush up the SteamManager to not act like a singleton making it a bit safer for when that 99.99% just copy and pastes and "ah sure its grand" the whole thing :) |
|
Hello, we (Yellow Dog Man Studios), have a fork of this where I just came across a similar issue. In this case this: Yellow-Dog-Man@fda7fd5 was the methodology that I chose. Once I had completed it, I came over here and found this PR. I wanted to provide my solution as a reference. With my methodology, consumers who want the new behavior can opt in with: But users who are happy with, or do not want the breaking change do not have to make any changes. This preserves backwards compatibility. Ultimately, either solution will work for my requirements, but I wanted to provide some information on our solution in case it helped the discussion, thanks! |
|
I like that a lot, it looks like a simple change that moves us closer to this? Maybe the next step could literally just be some sort of #if to exclude the unity reference? |
To improve compile times, I've removed the UnityEngine from the base of the plugin. The one reference was simply to pass along exception logging, so I've instead replaced it with a static delegate. In SteamManager.cs, you can hook into this delegate in OnEnable()/OnDisable().
I've attached some before and after examples of how compile times an be affected by this dependency chain change.

