// Use this for initialization void Start() { // Initialize the current emotion currentCumulativeEmotion = new EmotionStruct(); uiManagerScript = uIManager.GetComponent <UIManager> (); // Find the script for facial emotion analysis try { facialAnalyzer = (FacialEmotionAnalyzer)facialEmotionAnalyzerObject.GetComponent(typeof(FacialEmotionAnalyzer)); // this seems to fail silently... } catch (System.Exception) { Debug.Log("Unable to find facial emotion analyzer. This functionality will be disabled."); useFacialEmotion = false; } }
// Use this for initialization void Start() { uiManagerScript = uiManager.GetComponent <UIManager> (); // Initialize the current emotion // currentFacialEmotion = new EmotionStruct(); // currentWordSentimentEmotion = new EmotionStruct(); // currentVocalEmotion = new ToneAnalysis(); // Enable and disable emotion modality game objects based on the flags // if (useFacialEmotion) // { // facialEmotionAnalyzerObject.SetActive(false); // } // if (useWordSentimentEmotion) // { // wordSentimentEmotionAnalyzerObject.SetActive(false); // } // if (useVocalToneEmotion) // { // vocalEmotionAnalyzerObject.SetActive(false); // } // // Find the script for facial emotion analysis // try // { // facialAnalyzer = (FacialEmotionAnalyzer) facialEmotionAnalyzerObject.GetComponent(typeof(FacialEmotionAnalyzer)); // this seems to fail silently... // } // catch (System.Exception) // { // Debug.Log("Unable to find facial emotion analyzer. This functionality will be disabled."); // useFacialEmotion = false; // } // // Find the script for sentiment analysis of speech to text results // try // { // wordAnalyzer = (SentimentAnalyzer) wordSentimentEmotionAnalyzerObject.GetComponent(typeof(SentimentAnalyzer)); // } // catch (System.Exception) // { // Debug.Log("Unable to find the sentiment analyzer. This functionality will be disabled."); // useWordSentimentEmotion = false; // } // // Find the script for vocal analysis results // try // { // vocalAnalyzer = (MicControlC) vocalEmotionAnalyzerObject.GetComponent(typeof(MicControlC)); // } // catch (System.Exception) // { // Debug.Log("Unable to find the vocal analyzer. This functionality will be disabled."); // useVocalToneEmotion = false; // } if (!useFacialEmotion) { facialEmotionAnalyzerObject.SetActive(false); } else { facialAnalyzer = (FacialEmotionAnalyzer)facialEmotionAnalyzerObject.GetComponent(typeof(FacialEmotionAnalyzer)); facialAnalyzer2 = (FacialEmotionAnalyzer2)facialEmotionAnalyzer2Object.GetComponent(typeof(FacialEmotionAnalyzer2)); Debug.Log(facialAnalyzer2); } if (!useWordSentimentEmotion) { wordSentimentEmotionAnalyzerObject.SetActive(false); } else { wordAnalyzer = (SentimentAnalyzer)wordSentimentEmotionAnalyzerObject.GetComponent(typeof(SentimentAnalyzer)); } if (!useVocalToneEmotion) { vocalEmotionAnalyzerObject.SetActive(false); } else { vocalAnalyzer = (MicControlC)vocalEmotionAnalyzerObject.GetComponent(typeof(MicControlC)); StartCoroutine(passAudio()); } }