-
April 26: UI common prefab for TA Variables
04/27/2018 at 04:06 • 0 commentsTook the Joy element from last revision and tweaked it a bit, then saved back to prefab and repositioned others.
New style uses the Panel's Text element to display a label, and a UI.Text element to display the value within the Filled element. New script supersedes both Hipple ImageVar slider and the previous SOUI element.
-
April 26: Working UI components Connected to live IBM Service
04/27/2018 at 00:20 • 0 commentsFilled in Credential details, bolted up the Responders and some UI components to show FloatVariables returned by ToneAnalysis
Generally the UI element is Lable and one of Hipple's bar graphs. The Joy element also adds a Value display in Text field. I like this and should examine in detail for use as prefab with one script filling in the Name, Text Value, Graphic components.
The Credentials work well. I definitely prefer the TA approach using string properties over the other that uses StringVariables. It keeps them close in one display, vs inspecting several components.
-
TestSO Scene 1 Created
04/24/2018 at 22:39 • 0 commentsGitHub revised (renamed). Created a first Test Scene with WatsonService and Text/Image UI components for the recognized text and basic tone analysis (joy, sadness, anger, fear, disgust) using image bars.
Service should put the data into SOs when arrives. Relies on the UI component Update functions to fill in the values. Might be better to use Event callbacks but not yet implemented.
-
First SO: WatsonCredentials (username, password, url)
04/19/2018 at 07:12 • 0 commentsProject in UnityCollab with mashup import of my older, IBM cs code, Hipple SO github. Then started playing with how to merge in ScriptableObject...
First step is noticing that the IBM Credentials (username, password, url) are perfect candidates for ScriptableObject. So I created two tests
one using strings, one using StringVariables.
To the client code (WatsonService) the SO and SO_Simple are identical. Using StringVariables takes more steps in Editor setting up SOs etc. May be easier to do it _Simple way. There are fewer steps and Assets created, unless you want to compose at that granularity.
I’ll leave both techniques in the code to show alternatives and how it affects the project.
Here is the basic code for now…
public class WatsonCredentialsSO_Simple : ScriptableObject { [SerializeField] private string _username ; [SerializeField] private string _password ; [SerializeField] private string _url ; public string Username { get { return _username; } set { _username = value; } } public string Password { get { return _password; } set { _password = value; } } public string URL { get { return _url; } set { _url.Value = value; } } } [CreateAssetMenu] public class WatsonCredentialsSO : ScriptableObject { [SerializeField] private StringVariable _username ; [SerializeField] private StringVariable _password ; [SerializeField] private StringVariable _url ; public string Username { get { return _username.Value; } set { _username.Value = value; } } public string Password { get { return _password.Value; } set { _password.Value = value; } } public string URL { get { return _url.Value; } set { _url.Value = value; } } } ublic class WatsonSTT_TAService : MonoBehaviour { [SerializeField] WatsonCredentialsSO stt_credentialSO; [SerializeField] WatsonCredentialsSO_Simple ta_credentialSO; private Credentials credentials_STT; private Credentials credentials_TA; void Awake () { print("Speech2Text user: " + stt_credentialSO.Username); print("Speech2Text pwd: " + stt_credentialSO.Password); print("Speech2Text url: " + stt_credentialSO.URL); print("ToneAnalysis user: " + ta_credentialSO.Username); print("ToneAnalysis pwd: " + ta_credentialSO.Password); print("ToneAnalysis url: " + ta_credentialSO.URL); credentials_STT = new Credentials( stt_credentialSO.Username, stt_credentialSO.Password, stt_credentialSO.URL); credentials_TA = new Credentials( ta_credentialSO.Username, ta_credentialSO.Password, ta_credentialSO.URL); } // Update is called once per frame void Update () { } }
oh my that doesnt paste in very well at all does it?
-
2018-04-15 First Log
04/16/2018 at 01:26 • 0 commentsFirst Log. 4-15-2018
The GitHub is up to date with as-is code. The Hackaday documentation is basic. Now I start on the ScriptableObject rewrite of scenes, and classes.