loodakrawa / SpriterDotNet

A pure C# Spriter implementation
zlib License
220 stars 75 forks source link

Unity example project settings #88

Closed rfadeev closed 6 years ago

rfadeev commented 6 years ago

Hi,

What was the reason behind removing ProjectSettings folder here https://github.com/loodakrawa/SpriterDotNet/commit/618ed8e987022bd491ca716cc712441d57c54294? I see this explanation but it does not provide enough information:

Removed the ProjectSettings from being managed code for reasons of
cross-version compatibility and eventual deployment as a unitypackage.

Is cross-version compatibility still an issue? If not, I would propose returning project settings back instead of ignoring it.

Pros:

Cons:

Maybe I'm missing something else, would be glad to hear about whatever I missed.

Regards, Roman

loodakrawa commented 6 years ago

Hi Roman,

The reasoning for that removal was that ProjectSettings is not source data, but rather something that can and arguably should be rebuilt. Also, I'm not sure about backwards compatibility - is a newer ProjectSettings compatible with an older version of Unity?

Anyway, when and if I continue with the Unity development I'll take a better look into this.

rfadeev commented 6 years ago

Hi loodakrawa,

Thanks for the response! Got it, one can argue whether ProjectSettings is source data or not. Depends on how corresponding folder should be treated. If it's for .unitypackage generation then project settings can be ignored (though I would still keep them). If it's supposed to be treated as Unity project then ProjectSettings is source data for sure. Note that ProjectSettings contain project specific data like editor and graphic settings.

Newer project settings are compatible with older versions of Unity. When you open Unity project which has project settings, Unity will warn user of opening project with version different from the one project was saved. If open the project with new Unity version and save it, affected files in ProjectSettings get updated.

My question arose from the case of opening SpriterDotNet.Unity folder as Unity project and observing asset files (scenes, prefabs) changed though I did not modify them. If ProjectSetting were present, I would download corresponding Unity version (which is saved in project settings), open SpriterDotNet.Unity as Unity project with downloaded version of Unity and observe no changes.

Moreover, I was thinking of pull request with changing asset serialization to text so those changes would be present in diff (currently all asset files are binary). But for that ideally would be opening SpriterDotNet.Unity project with Unity version it was saved which sadly I do not know.

Regards, Roman

loodakrawa commented 6 years ago

Sorry for the slow responses - I'm very busy these days.

I tried to find official information about ProjectSettings being backwards compatible and I couldn't. Do you have a source for that?

When you say asset serialisation from binary to text - what exactly do you mean? Because the .meta files are already written as text. Which other assets can you change to a text format?

rfadeev commented 6 years ago

No problem!

Regarding ProjectSettings compatibility - I do not have official information on that, judging by my personal exprience of updating projects in production to newer Unity versions. Though ProjectSettings are mentioned to be added under source control of the project here: https://docs.unity3d.com/Manual/ExternalVersionControlSystemSupport.html

When I speak of asset serialization I mean prefabs (.prefab files like this) and scenes (.unity files like this). You can find information on asset serialization options here: https://docs.unity3d.com/Manual/class-EditorManager.html.

Regards, Roman

loodakrawa commented 6 years ago

If you want, feel free to add a PR with ProjectSettings (created with a recent version of Unity) and I'll happily merge it.