111 lines
3.4 KiB
C#
111 lines
3.4 KiB
C#
using FSM;
|
|
using UnityEngine;
|
|
using ZXKFramework;
|
|
namespace YiLiao.JingMaiLiuZhiZhen
|
|
{
|
|
public class JianChaYaoYeState : FsmState<FSMManager>
|
|
{
|
|
public override void OnStateEnter()
|
|
{
|
|
base.OnStateEnter();
|
|
fsm.ShowCamera("JianChaYaoYeState_Camera");
|
|
fsm.ShowTip(0);
|
|
fsm.PlayBgm(0);
|
|
fsm.PlayClip("检查药液", () => {
|
|
fsm.ShowSpeakPanel(new UnityEngine.Vector3(640, 0),
|
|
"外观检查:包装完整无渗漏,液体澄明无色。",
|
|
"液体澄明无色", 0, 1, SpeakAction);
|
|
});
|
|
}
|
|
|
|
private void SpeakAction(int args1, string arg2)
|
|
{
|
|
if (args1 == 1)
|
|
{
|
|
if(fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(2, 1);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
fsm.AddScore(1, 1);
|
|
}
|
|
}
|
|
else if(args1 == 0)
|
|
{
|
|
fsm.AddScore(0, 1);
|
|
}
|
|
else
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
fsm.ShowTip(1,true);
|
|
fsm.PlayBgm(1,true);
|
|
fsm.ShowArrow("请拖拽氯化钠溶液",new Vector2(-15.6f, 85.1f),1, 1, 60,true);
|
|
fsm.Light_EnableInteraction("检查药液_氯化钠", true);
|
|
fsm.InteractionStay("检查药液_氯化钠", HandleAction);
|
|
}
|
|
|
|
private void HandleAction(GameObject obj)
|
|
{
|
|
if(obj.name == "检查药液_氯化钠")
|
|
{
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(2, 2);
|
|
}
|
|
fsm.Unlight_DisableInteraction("检查药液_氯化钠");
|
|
fsm.InteractionStay("检查药液_氯化钠", null);
|
|
fsm.HideArrow();
|
|
fsm.PlayClip("检查药液2", () => {
|
|
fsm.ShowTip(2);
|
|
fsm.PlayBgm(2);
|
|
fsm.ShowSpeakPanel(new UnityEngine.Vector3(640, 0),
|
|
"倒置观察:瓶底无颗粒沉淀,液体均匀无分层。",
|
|
"液体均匀无分层", 0, 1, SpeakAction2);
|
|
});
|
|
}
|
|
}
|
|
|
|
private void SpeakAction2(int arg1, string arg2)
|
|
{
|
|
if (arg1 == 1)
|
|
{
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(2, 3);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
fsm.AddScore(1, 2);
|
|
}
|
|
}
|
|
else if(arg1 == 0)
|
|
{
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(0, 3);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
fsm.AddScore(0, 2);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
Game.Instance.eventManager.Raise(new PlayTrueOrFalseEvent() { isTrue = true });
|
|
}
|
|
fsm.PlayClip("检查药液3", () => {
|
|
fsm.nextState = true;
|
|
});
|
|
}
|
|
|
|
public override void OnStateExit()
|
|
{
|
|
base.OnStateExit();
|
|
fsm.PlayClip("检查药液Reset");
|
|
fsm.nextState = false;
|
|
}
|
|
}
|
|
}
|