This has to do with packages/assets being released for the Asset Store.
I’ve been discussing this with a friend today as we want to collaborate in a way. The new tool I am working on should have the ability to, when it detects the presence of his package, allow additional features while making calls to his code to do the actual work.
I was hoping it would be as simple as doing #if SOME_CLASS_NAME (C#) but I see it can’t be used like that. So now I am not quite sure how one can write code that will not throw errors if the other package’s classes are not present.
So far I can only think of having some unitypackage that can be imported which would add the script(s) that provide the working link between the two.
I would create a script with the needed class and function(s) that my code can call into and these functions would make calls to my friend’s scripts. I distribute my tool with an “empty” version of this class, its functions will be be empty/ do nothing and thus have no code that can throw errors cause of the other package’s classes not being present.
If a user then installs my friend’s package and want my tool to support it he can import/extract the version of my script which has the actual working code.
Any thoughts on this? Is there a better way this could be done? I do not want my customers to really worry about what I described above. Things should just work.