最新修改提交

This commit is contained in:
高铎 2025-09-25 17:30:19 +08:00
parent b09af4e2c2
commit 797abebf95
10 changed files with 72 additions and 24 deletions

View File

@ -69804,7 +69804,7 @@ PrefabInstance:
- target: {fileID: 5206904217386052552, guid: f5f8e47786f2ac047b17154888dd753d, - target: {fileID: 5206904217386052552, guid: f5f8e47786f2ac047b17154888dd753d,
type: 3} type: 3}
propertyPath: m_IsActive propertyPath: m_IsActive
value: 1 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5206904217386052555, guid: f5f8e47786f2ac047b17154888dd753d, - target: {fileID: 5206904217386052555, guid: f5f8e47786f2ac047b17154888dd753d,
type: 3} type: 3}

View File

@ -272,30 +272,51 @@ namespace DongWuYiXue.DaoNiaoShu
Unlight(value); Unlight(value);
GameManager.Instance.interactionManager.DisableInteraction(value); GameManager.Instance.interactionManager.DisableInteraction(value);
} }
public void ShowTxtQuestion(int id, int score, int scoreId, Action nextFun) //public void ShowTxtQuestion(int id, int score, int scoreId, Action nextFun)
//{
// TxtSelectQuestionPanel txtSelectQuestionPanel = GameManager.Instance.uiManager.GetUI<TxtSelectQuestionPanel>();
// txtSelectQuestionPanel.ShowImgQuestion(id);
// txtSelectQuestionPanel.nextAction = nextFun;
// txtSelectQuestionPanel.subAction = isTrue =>
// {
// if (main_gameModel.modeType == ModeType.KaoHe)
// {
// if (isTrue)
// {
// AddScore(score, scoreId);
// }
// else
// {
// AddScore(0, scoreId);
// }
// }
// else
// {
// Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = isTrue });
// }
// };
//}
public void ShowTxtQuestion(string stepName, int id, int scoreId, int score, Action nextFun)
{ {
TxtSelectQuestionPanel txtSelectQuestionPanel = GameManager.Instance.uiManager.GetUI<TxtSelectQuestionPanel>(); TxtSelectQuestionPanel txtSelectQuestionPanel = GameManager.Instance.uiManager.GetUI<TxtSelectQuestionPanel>();
txtSelectQuestionPanel.ShowImgQuestion(id); txtSelectQuestionPanel.ShowImgQuestion(id, stepName);
txtSelectQuestionPanel.nextAction = nextFun; txtSelectQuestionPanel.nextAction = nextFun;
txtSelectQuestionPanel.subAction = isTrue => txtSelectQuestionPanel.subAction = isTure =>
{ {
if (main_gameModel.modeType == ModeType.KaoHe) if (isTure)
{ {
if (isTrue) GameManager.Instance.kaoheManager.AddScore(score, scoreId, (s, t) => {
{ GameManager.Instance.uiManager.GetUI<ScorePanel>().SetScore(s.ToString(), t.ToString());
AddScore(score, scoreId); });
}
else
{
AddScore(0, scoreId);
}
} }
else else
{ {
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = isTrue }); GameManager.Instance.kaoheManager.AddScore(0, scoreId, null);
} }
}; };
} }
public void ShowImgQuestion(int id, int score, int scoreId, Action nextFun) public void ShowImgQuestion(int id, int score, int scoreId, Action nextFun)
{ {
ImgSelectQuestionPanel imgSelectQuestionPanel = GameManager.Instance.uiManager.GetUI<ImgSelectQuestionPanel>(); ImgSelectQuestionPanel imgSelectQuestionPanel = GameManager.Instance.uiManager.GetUI<ImgSelectQuestionPanel>();

View File

@ -14,7 +14,7 @@ namespace DongWuYiXue.DaoNiaoShu
fsm.ShowCamera("暴露阴茎1_Camera"); fsm.ShowCamera("暴露阴茎1_Camera");
fsm.ShowTip(0); fsm.ShowTip(0);
fsm.PlayBgm(0); fsm.PlayBgm(0);
fsm.ShowSpeakPanel("꿨흙돔쿱밗》괬쨋綾쑤", "셨崎쉥관튄蕨빈股箕", new Vector3(-220f, 235f), 2, 0, 3, (c) => fsm.ShowSpeakPanel("插入导尿管》暴露阴茎", "请助手继续将包皮向后推压暴露阴茎2-5cm", new Vector3(-220f, 235f), 2, 0, 3, (c) =>
{ {
fsm.Hide("女助手文字位置"); fsm.Hide("女助手文字位置");
fsm.ShowCamera("暴露阴茎2_Camera"); fsm.ShowCamera("暴露阴茎2_Camera");

View File

@ -39,7 +39,7 @@ namespace DongWuYiXue.DaoNiaoShu
GameManager.Instance.uiManager.ShowUI<StartKaoHePanel>(); GameManager.Instance.uiManager.ShowUI<StartKaoHePanel>();
GameManager.Instance.uiManager.GetUI<StartKaoHePanel>().callback = () => GameManager.Instance.uiManager.GetUI<StartKaoHePanel>().callback = () =>
{ {
fsm.ShowTxtQuestion(0, 3, 0, () => fsm.ShowTxtQuestion("²¡Àý¡·²¡Àý¡·²½Öè1",0, 0, 3, () =>
{ {
PlayVideo(); PlayVideo();
}); });
@ -65,7 +65,7 @@ namespace DongWuYiXue.DaoNiaoShu
} }
if (fsm.main_gameModel.modeType == ModeType.KaoHe) if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{ {
fsm.ShowTxtQuestion(1, 3, 1, () => fsm.ShowTxtQuestion("²¡Àý¡·²¡Àý¡·²½Öè1",1, 1, 3, () =>
{ {
fsm.nextState = true; fsm.nextState = true;
}); });

View File

@ -16,7 +16,7 @@ namespace DongWuYiXue.DaoNiaoShu
this.Log("进入测量方法状态"); this.Log("进入测量方法状态");
if (fsm.main_gameModel.modeType == ModeType.KaoHe) if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{ {
fsm.ShowTxtQuestion(2, 3, 0, () => fsm.ShowTxtQuestion("测量导尿管》测量方法》步骤1",2, 0, 3, () =>
{ {
niaoDaoKou_Btn = GameManager.Instance.transform.FindFirst<Button>("尿道口按钮"); niaoDaoKou_Btn = GameManager.Instance.transform.FindFirst<Button>("尿道口按钮");
niaoDaoKou_Btn.onClick.RemoveAllListeners(); niaoDaoKou_Btn.onClick.RemoveAllListeners();

View File

@ -65,7 +65,7 @@ namespace DongWuYiXue.DaoNiaoShu
} }
if (fsm.main_gameModel.modeType == ModeType.KaoHe) if (fsm.main_gameModel.modeType == ModeType.KaoHe)
{ {
fsm.ShowTxtQuestion(3, 3, 5, () => fsm.ShowTxtQuestion("²åÈëµ¼Äò¹Ü¡·²å¹Ü¡·²½Öè2",3, 5, 3, () =>
{ {
fsm.nextState = true; fsm.nextState = true;
}); });

View File

@ -18,6 +18,7 @@ namespace DongWuYiXue.DaoNiaoShu
rightImg = transform.FindFirst<Image>("Right"); rightImg = transform.FindFirst<Image>("Right");
falseImg = transform.FindFirst<Image>("False"); falseImg = transform.FindFirst<Image>("False");
toggle.onValueChanged.AddListener(OnValueChanged); toggle.onValueChanged.AddListener(OnValueChanged);
transform.name = transform.FindFirst<Text>("Num").text;
} }
public void SetRightColor() public void SetRightColor()
{ {

View File

@ -2,6 +2,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
using ZXKFramework;
namespace DongWuYiXue.DaoNiaoShu namespace DongWuYiXue.DaoNiaoShu
{ {
public class TxtSelectManager : MonoBehaviour public class TxtSelectManager : MonoBehaviour
@ -48,5 +49,19 @@ namespace DongWuYiXue.DaoNiaoShu
if (array1.Length != array2.Length) return false; // 如果长度不同返回false if (array1.Length != array2.Length) return false; // 如果长度不同返回false
return array1.SequenceEqual(array2); // 使用SequenceEqual判断内容是否完全相同 return array1.SequenceEqual(array2); // 使用SequenceEqual判断内容是否完全相同
} }
public string GetYourAnswer()
{
TxtOption[] yourSelect = txtOptions.ToList().FindAll(e => e.isSelect == true).ToArray();
string str = "";
for (int i = 0; i < yourSelect.Length; i++)
{
str += yourSelect[i].name;
}
if(string.IsNullOrEmpty(str))
{
return "¿Õ";
}
return str;
}
} }
} }

View File

@ -14,6 +14,7 @@ namespace DongWuYiXue.DaoNiaoShu
Button nextBtn; Button nextBtn;
Button subBtn; Button subBtn;
int id; int id;
string stepName;
public override void Init(IUIManager uictrl) public override void Init(IUIManager uictrl)
{ {
base.Init(uictrl); base.Init(uictrl);
@ -28,26 +29,36 @@ namespace DongWuYiXue.DaoNiaoShu
if (txtSelectManagers[id].Check()) if (txtSelectManagers[id].Check())
{ {
subAction?.Invoke(true); subAction?.Invoke(true);
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
} }
else else
{ {
subAction?.Invoke(false); Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = false });
if (MVC.GetModel<Main.GameModel>().modeType == ModeType.ShiXun)
{
ChatUI.Instance.SendAI("用户位于:" + stepName + ",用户的作答为:" + txtSelectManagers[id].GetYourAnswer() + ",请对用户的作答进行解析,并介绍本步骤正确答案和意义,字数控制在100字以内。", null);
}
else
{
subAction?.Invoke(false);
}
} }
subBtn.gameObject.SetActive(false); subBtn.gameObject.SetActive(false);
nextBtn.gameObject.SetActive(true); nextBtn.gameObject.SetActive(true);
} }
private void Next() private void Next()
{ {
ChatUI.Instance.CloseChatTxt();
SetActive(false); SetActive(false);
subBtn.gameObject.SetActive(true); subBtn.gameObject.SetActive(true);
nextBtn.gameObject.SetActive(false); nextBtn.gameObject.SetActive(false);
nextAction?.Invoke(); nextAction?.Invoke();
} }
public void ShowImgQuestion(int id) public void ShowImgQuestion(int id, string stepName)
{ {
SetActive(true); SetActive(true);
subBtn.gameObject.SetActive(true);
this.id = id; this.id = id;
this.stepName = stepName;
for (int i = 0; i < txtSelectManagers.Length; i++) for (int i = 0; i < txtSelectManagers.Length; i++)
{ {
if (i == id) if (i == id)