修改TreeViewPanel前提交
This commit is contained in:
parent
797abebf95
commit
0176b452ae
@ -52,7 +52,8 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
UIBehaviourExtension.OnEventButtonEvent(Voice.gameObject, EventTriggerType.PointerUp, onMicrophoneUp);
|
UIBehaviourExtension.OnEventButtonEvent(Voice.gameObject, EventTriggerType.PointerUp, onMicrophoneUp);
|
||||||
userInput.onValidateInput += OnValidateInput;
|
userInput.onValidateInput += OnValidateInput;
|
||||||
Send.onClick.AddListener(Submit);
|
Send.onClick.AddListener(Submit);
|
||||||
tip.onClick.AddListener(() => {
|
tip.onClick.AddListener(() =>
|
||||||
|
{
|
||||||
userInput.text = tipTxt;
|
userInput.text = tipTxt;
|
||||||
clickTip = true;
|
clickTip = true;
|
||||||
});
|
});
|
||||||
@ -79,7 +80,8 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
{
|
{
|
||||||
btnsContent.SetActive(false);
|
btnsContent.SetActive(false);
|
||||||
userInput.readOnly = true;
|
userInput.readOnly = true;
|
||||||
ChatAI.Instance.SendData("用户处于," + stepName + ",用户口述了" + userInput.text + ",请你判断,正确返回true,错误返回false", str => {
|
ChatAI.Instance.SendData("用户处于," + stepName + ",用户口述了" + userInput.text + ",请你判断,正确返回true,错误返回false", str =>
|
||||||
|
{
|
||||||
if (str.Contains("true"))
|
if (str.Contains("true"))
|
||||||
{
|
{
|
||||||
if (clickTip)
|
if (clickTip)
|
||||||
@ -90,7 +92,8 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameManager.Instance.kaoheManager.AddScore(score, id, (s, t) => {
|
GameManager.Instance.kaoheManager.AddScore(score, id, (s, t) =>
|
||||||
|
{
|
||||||
GameManager.Instance.uiManager.GetUI<ScorePanel>().SetScore(s.ToString(), t.ToString());
|
GameManager.Instance.uiManager.GetUI<ScorePanel>().SetScore(s.ToString(), t.ToString());
|
||||||
});
|
});
|
||||||
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
||||||
@ -103,8 +106,10 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = false });
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = false });
|
||||||
if (MVC.GetModel<Main.GameModel>().modeType == ModeType.ShiXun)
|
if (MVC.GetModel<Main.GameModel>().modeType == ModeType.ShiXun)
|
||||||
{
|
{
|
||||||
Game.Instance.IEnumeratorManager.Run(0.1f, () => {
|
Game.Instance.IEnumeratorManager.Run(0.1f, () =>
|
||||||
ChatUI.Instance.SendAINext("用户处于," + stepName + ",请你对用户口述内容进行解析,并且介绍本步骤的答案和意义", () => {
|
{
|
||||||
|
ChatUI.Instance.SendAINext("用户处于," + stepName + ",请你对用户口述内容进行解析,并且介绍本步骤的答案和意义", () =>
|
||||||
|
{
|
||||||
userInput.text = tipTxt;
|
userInput.text = tipTxt;
|
||||||
sendAction?.Invoke(false);
|
sendAction?.Invoke(false);
|
||||||
});
|
});
|
||||||
@ -115,7 +120,7 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
sendAction?.Invoke(false);
|
sendAction?.Invoke(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (str.Contains("error"))
|
else if (str.Contains("error") || string.IsNullOrEmpty(str))
|
||||||
{
|
{
|
||||||
GameManager.Instance.fsm.AddScore(0, id);
|
GameManager.Instance.fsm.AddScore(0, id);
|
||||||
userInput.text = tipTxt;
|
userInput.text = tipTxt;
|
||||||
@ -132,7 +137,8 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
|
|
||||||
public void ShowSpeakPanel(string stepName, string tipTxt, Vector2 v, int delayShowTime, int id, int score, Action<bool> callBack)
|
public void ShowSpeakPanel(string stepName, string tipTxt, Vector2 v, int delayShowTime, int id, int score, Action<bool> callBack)
|
||||||
{
|
{
|
||||||
coroutine = Game.Instance.IEnumeratorManager.Run((int)delayShowTime, () => {
|
coroutine = Game.Instance.IEnumeratorManager.Run((int)delayShowTime, () =>
|
||||||
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.tipTxt = tipTxt;
|
this.tipTxt = tipTxt;
|
||||||
this.score = score;
|
this.score = score;
|
||||||
@ -172,7 +178,8 @@ namespace DongWuYiXue.DaoNiaoShu
|
|||||||
inputContent.SetActive(true);
|
inputContent.SetActive(true);
|
||||||
MicrophoneImg.SetActive(false);
|
MicrophoneImg.SetActive(false);
|
||||||
transform.FindFirst<Animator>("boxing").enabled = false;
|
transform.FindFirst<Animator>("boxing").enabled = false;
|
||||||
ChatAI.Instance.StopRecord(str => {
|
ChatAI.Instance.StopRecord(str =>
|
||||||
|
{
|
||||||
userInput.text += str;
|
userInput.text += str;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user