166 lines
5.5 KiB
C#
166 lines
5.5 KiB
C#
using FSM;
|
|
using System;
|
|
using UnityEngine;
|
|
using ZXKFramework;
|
|
namespace YiLiao.JingMaiLiuZhiZhen
|
|
{
|
|
public class JiLuState : FsmState<FSMManager>
|
|
{
|
|
public override void OnStateEnter()
|
|
{
|
|
base.OnStateEnter();
|
|
fsm.ShowCamera("JiLuState_Camera");
|
|
fsm.PlayClip("记录", () => {
|
|
fsm.ShowTip(0, true);
|
|
fsm.PlayBgm(0, true);
|
|
fsm.ShowSpeakPanel(new Vector3(364.5f, -185f), "", "", 2, 0, SpeakAction);
|
|
});
|
|
|
|
}
|
|
|
|
private void SpeakAction(int arg1, string arg2)
|
|
{
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(1, 1);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
//fsm.Get("长期医嘱单4").GetOrAddComponent<YiZhuDan>().SetTxt(arg2,0);
|
|
fsm.ShowTip(1, true);
|
|
fsm.PlayBgm(1, true);
|
|
fsm.ShowSpeakPanel(new Vector3(315f, -222.8f), "右手背", "右手背", 0, 0, SpeakAction2);
|
|
}
|
|
|
|
private void SpeakAction2(int arg1, string arg2)
|
|
{
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
if (arg1 == 1)
|
|
{
|
|
fsm.AddScore(1, 2);
|
|
}
|
|
else if (arg1 == 0)
|
|
{
|
|
fsm.AddScore(0, 2);
|
|
}
|
|
else
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
}
|
|
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
if (arg1 == 1)
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
else if (arg1 == 0)
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = false });
|
|
}
|
|
else
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
}
|
|
fsm.ShowTip(2, true);
|
|
fsm.PlayBgm(2, true);
|
|
//fsm.Get("长期医嘱单4").GetOrAddComponent<YiZhuDan>().SetTxt(arg2, 1);
|
|
fsm.ShowSpeakPanel(new Vector3(158f, -255f), "", "", 0, 0, SpeakAction3);
|
|
}
|
|
|
|
private void SpeakAction3(int arg1, string arg2)
|
|
{
|
|
if(int.TryParse(arg2,out int temp) && Convert.ToInt32(arg2) >= 55 && Convert.ToInt32(arg2) <= 80 )
|
|
{
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(1, 3);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(0, 3);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = false });
|
|
}
|
|
}
|
|
fsm.ShowTip(3, true);
|
|
fsm.PlayBgm(3, true);
|
|
//fsm.Get("长期医嘱单4").GetOrAddComponent<YiZhuDan>().SetTxt(arg2, 2);
|
|
fsm.ShowSpeakPanel(new Vector3(317f, -290f), "无红肿", "无红肿", 0, 0, SpeakAction4);
|
|
}
|
|
|
|
private void SpeakAction4(int arg1, string arg2)
|
|
{
|
|
fsm.HideTip();
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
if (arg1 == 1)
|
|
{
|
|
fsm.AddScore(1, 4);
|
|
}
|
|
else if (arg1 == 0)
|
|
{
|
|
fsm.AddScore(0, 4);
|
|
}
|
|
else
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
if (arg1 == 1)
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
else if (arg1 == 0)
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = false });
|
|
}
|
|
else
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
}
|
|
fsm.ShowTip(4);
|
|
fsm.PlayBgm(4);
|
|
//fsm.Get("长期医嘱单4").GetOrAddComponent<YiZhuDan>().SetTxt(arg2, 3);
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.ShowNextPanel(ChengJi);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
fsm.ShowTxtQuestion(6, 5, 1, () => {
|
|
ChengJi();
|
|
});
|
|
}
|
|
}
|
|
void ChengJi()
|
|
{
|
|
fsm.PlayClip("记录2", () =>{
|
|
fsm.nextState = true;
|
|
});
|
|
}
|
|
public override void OnStateExit()
|
|
{
|
|
base.OnStateExit();
|
|
fsm.nextState = false;
|
|
}
|
|
}
|
|
}
|