Hi unity gurus just some background on the problem.
I’m trying to make use of the Watson Unity SDK. When imported into unity and opened in visual studio, the Watson SDK is its own project. I can run the SDK just fine and get the result i want. However, i can’t seem to find an easy way to pass it back to my unity script.
The reason for this is that my script is compiled into the default unity “Assembly-CSharp”. This project however references the “WatsonUnitySDK” hence, i can’t reference back to the “Assembly-CSharp” to access my class, due to the circular dependency.
This seems like it should be 101 but i’m stumped. Can anyone give me some advise?
First, follow the directions on the README here: GitHub - watson-developer-cloud/unity-sdk: 🎮 Unity SDK to use the IBM Watson services.
Second - you shouldn’t be changing any code or adding any code to the Watson SDK. It’s a one-way street. Your code can make use of Watson code, but not the other way around.
Hi PraetorBlue,
Thank you for the fast reply. i am not changing the Watson Code in the sense of logic changes. I can pass my input data to it and it can analyse my data just fine. However, i would then like to pass the result back to my own code to control the application/app logic.
If its a 1 way street meaning that i can pass my input to it, it can analyse it and I can’t get the result back wouldn’t that make it not very useful?
It is precisely because i want to minimize changes to the Watson SDK project itself that I would like to keep the logic within the unity project rather then start extending the watson project with my own code and app control logic, hence i would need a way to pass the result back from the watson project to the unity project.
The only relevant portion of the readme only mentions callbacks. Using callbacks is fine, but once again, the callback is restricted to classes and methods within the watson project.
There are of course less elegant methods such as passing it to a unity ui object such as input field and then reading the UI object, or using an on change method to pull the data from theUI back into my unity code but i would like to avoid these type of solutions if possible.