keijiro / KlakSpout

Spout plugin for Unity
The Unlicense
673 stars 101 forks source link

What is the appropriate way to modify SpoutReceiver.cs without it being overwritten by the ScopedRegistry? #65

Closed ToxMox closed 3 years ago

ToxMox commented 3 years ago

Hi,

I'm trying to make some changes to my SpoutReceiver.cs code but it keeps being reverted to default. I'm assuming it has something to do with the Scoped Registry setup. What the recommended/appropriate way to modify scripts within a library of a scoped registry?

Thanks!

keijiro commented 3 years ago

This is a general Unity dev question rather than a project-specific question, so I only can give small tips.

When I have to add a modification to a package, I copy the package directory from Library/PackageCaches to Packages, then remove the package entry from manifest.json. Now I can safely modify the contents of Packages.

This is not the optimal way of development nor a recommended method. You can use the Unity forum to ask this kinds of questions.

keijiro commented 3 years ago

I'm closing this issue now. Please feel free to reopen it for further problems.

ToxMox commented 3 years ago

Ok I understand. So I'm trying to get the width and height from the SpoutReceiver component. Specifically these: var width = PluginEntry.GetTextureWidth(_plugin); var height = PluginEntry.GetTextureHeight(_plugin); Since there is no public reference to those variables in SpoutReceiver.cs in order to use GetComponent is there another way for me to get those values from another script without having to disconnect the live KlakSpout repo and modify SpoutReceiver?

Maybe there is a simple way that I don't understand yet and I apologize if this is a very basic question. I appreciate your help greatly! :)

Thank you!

keijiro commented 3 years ago

The texture dimensions are not publicly available in the current implementation. It makes sense to modify the code if you need them.