VeriorPies / ParrelSync

(Unity3D) Test multiplayer without building
MIT License
4.77k stars 328 forks source link

Feature add additional folders for symlinks #101

Closed katewilga closed 1 year ago

katewilga commented 1 year ago

[edit] added project settings image

Updated the preferences pane to allow users to add additional folders to be symlinked when creating a new clone

image

image

This provides a solution to both of these issues

[Feature Request] Select extra dependencies on Clone creation https://github.com/VeriorPies/ParrelSync/issues/51 [Feature Request] symbolic link to Library/PackageCache https://github.com/VeriorPies/ParrelSync/issues/67

RunninglVlan commented 1 year ago

I tried your change and don't understand where that ScriptableObject is used and why is it needed? I see that you save the list in EditorPrefs Update: Alright, I found it in Project Settings, but I don't understand why 2 places are needed. I don't think many would like to have some additional scriptable in their project

katewilga commented 1 year ago

Thank you for the comments @RunninglVlan, it's nice to meet someone in the pull request void :)

These options are available in two places because Editor Preferences are saved to the local machine, whereas Project Settings are set for all users of the project.

In our case, we have multiple users in the project. We need to be sure some folders are symlink'ed project wide via Project Settings. While some folders are only symlink'ed locally via Editor Preferences

Regarding, ScriptableObjects, afaik, this is standard practice when adding a menu to Project Settings. Looking at other plugins, this is what they do. Other plugins do seem to contain their ScriptableObject settings .asset files within their respective plugin folders, which I should do as well. I will fix that.

RunninglVlan commented 1 year ago

What other plugins are you referring to? I'd like to see examples too =) I see that some Unity project settings are saved in /ProjectSettings BTW, we're using ParrelSync as a package, so it isn't located in plugin folder, but in /Library/PackageCache... and you can't write there. I also noticed that you're using simple ScriptableObject, I just found out there's also ScriptableSingleton, for example, Rider package uses that. I guess it can be used for project settings, but I haven't checked that yet

katewilga commented 1 year ago

I see that some Unity project settings are saved in /ProjectSettings

I noticed that as well, but I don't see any external packages doing that.
I have not investigated, I assume this is for native settings only.

What other plugins are you referring to? I'd like to see examples too =)

The other packages don't always put them in the "plugins" folder, but they do seem to put them in a more purposeful location that what I had before. A quick search of "settings t:scriptableobject" in Project explorer, this is what is found:

Assets/Wwise/ScriptableObjects/AkWwiseInitializationSettings.asset
Assets/Resources/DOTweenSettings.asset
Assets/Configs/Input/InputSystem.inputsettings.asset
Assets/Plugins/TextMesh Pro/Resources/TMP Settings.asset
Assets/Render/UniversalRenderPipelineGlobalSettings.asset

there's also ScriptableSingleton

nice find! that would have been nice two days ago when I was applying the singleton pattern to a different ScriptableObject ;) as far as applying it to this pull, I don't have the cycles at this time to refactor

314pies commented 1 year ago

LGTM! Thanks, @mwilga!