// Update is called once per frame void Update() { vol = Mic_Test.Geta(); //Debug.Log(vol); if (vol < 2.0f) { R = 0.5f; L = 1.0f; //Debug.Log("Waiting"); } else if (vol > 3 && vol < 10) { R = 0.75f; L = 1.5f; //Debug.Log("Listening"); } else if (vol > 15) { R = 0.75f; L = 1.0f; //Debug.Log("Utterance"); } }
// Update is called once per frame void Update() { vol = Mic_Test.Geta(); Debug.Log(vol); if (vol <= 0.5f) { R = 0.75f; L = 1.5f; //Debug.Log("Waiting"); linda02.GetComponent <AIUEO>().enabled = false; } else if (vol > 0.5 && vol <= 1.5) { R = 0.9f; L = 2.0f; //Debug.Log("Listening"); linda02.GetComponent <AIUEO>().enabled = false; } else if (vol > 1.5) { float t = Time.deltaTime; if (t < 0.5f) { t = 0; R = 0.9f; L = 2.0f; } if (t > 5.0f) { t = 0; R = 0.9f; L = 1.5f; } else { t = 0; R = 0.75f; L = 1.5f; } //Debug.Log("Utterance"); linda02.GetComponent <AIUEO>().enabled = true; } }