// Update is called once per frame void Update() { #if UNITY_EDITOR if (Input.GetKeyDown(KeyCode.A)) { Dialog.Show(Localization.Get("Update_Title"), Localization.Get("Dialog_Ok"), Localization.Get("Dialog_Cancel"), () => { }, () => { }); } if (Input.GetKeyDown(KeyCode.B)) { Dialog.Show("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "ok", () => { }); } if (Input.GetKeyDown(KeyCode.C)) { ToastController.Show(false); } if (Input.GetKeyDown(KeyCode.U)) { UpdateDialog.Show(""); } if (Input.GetKeyDown(KeyCode.T)) { Localization.language = "en"; TipDialog.Show(); } if (Input.GetKeyDown(KeyCode.V)) { VoiceDialog.Show(); } if (Input.GetKeyDown(KeyCode.M)) { maskImage.color = Color.black; } if (Input.GetKeyDown(KeyCode.O)) { Toast.Show("This is a toast."); } #endif }
// 点击“语音助手面板”,开始语音识别 public void WakeUp() { int sp_tmall_protocol_value = OtherUtils.Instance.GetIntDataFromSp(Constant.SP_TMALL_PROTOCOL_KEY, Constant.SP_TMALL_PROTOCOL_DEF_VALUE); LogUtils.Log("sp_tmall_protocol_value = " + sp_tmall_protocol_value); if (sp_tmall_protocol_value != Constant.SP_TMALL_PROTOCOL_VALUE) { VoiceDialog.Show(); return; } if (!OtherUtils.Instance.GetNetStatus()) { //网络未连接,弹出提示 Toast.Show(Localization.Get("Net_TimeOut")); //网络未连接,唤醒语音,会反馈“网络有点问题,请连接网络” PicoUnityActivity.CallObjectMethod("wakeUp"); } else { PicoUnityActivity.CallObjectMethod("wakeUp"); SwitchPanel(true); } }