86 lines
3.4 KiB
C#
86 lines
3.4 KiB
C#
using FSM;
|
|
namespace YiLiao.JingMaiLiuZhiZhen
|
|
{
|
|
public class XiaoDuPingSaiState : FsmState<FSMManager>
|
|
{
|
|
public override void OnStateEnter()
|
|
{
|
|
base.OnStateEnter();
|
|
fsm.ShowCamera("XiaoDuPingSaiState_Camera");
|
|
fsm.PlayClip("消毒瓶塞", () => {
|
|
fsm.ShowCamera("XiaoDuPingSaiState_Camera2");
|
|
fsm.Show_Light_EnableInteraction("碘伏棉签1");
|
|
fsm.ShowArrow("拖拽碘伏棉签", "碘伏棉签1");
|
|
|
|
fsm.ShowTipBtn(() => {
|
|
fsm.Show_Light_EnableInteraction("碘伏棉签1",true);
|
|
fsm.ShowArrow("拖拽碘伏棉签", "碘伏棉签1",0,0,5,true);
|
|
},2);
|
|
|
|
fsm.PlayBgm(0);
|
|
fsm.ShowTip(0);
|
|
});
|
|
fsm.InteractionDown("碘伏棉签1", obj => {
|
|
fsm.HideTipBtn();
|
|
fsm.HideArrow();
|
|
fsm.Show_Light_EnableInteraction("瓶塞高亮处", true);
|
|
//obj.GetComponent<MianQian>().ChangeAfter();
|
|
});
|
|
fsm.InteractionUp("碘伏棉签1", obj => {
|
|
fsm.Hide_Unlight_DisableInteraction("瓶塞高亮处");
|
|
//obj.GetComponent<MianQian>().ChangeBefore();
|
|
});
|
|
fsm.InteractionDown("碘伏棉签2", obj => {
|
|
fsm.HideArrow();
|
|
fsm.HideTipBtn();
|
|
fsm.Show_Light_EnableInteraction("瓶塞高亮处", true);
|
|
//obj.GetComponent<MianQian>().ChangeAfter();
|
|
});
|
|
fsm.InteractionUp("碘伏棉签2", obj => {
|
|
fsm.Hide_Unlight_DisableInteraction("瓶塞高亮处");
|
|
//obj.GetComponent<MianQian>().ChangeBefore();
|
|
});
|
|
fsm.InteractionTrigger("瓶塞高亮处", obj => {
|
|
if(obj.name == "碘伏棉签1")
|
|
{
|
|
fsm.Unlight_DisableInteraction("瓶塞高亮处");
|
|
if (fsm.main_gameModel.modeType == ZXKFramework.ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(1, 1);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ZXKFramework.ModeType.KaoHe)
|
|
{
|
|
fsm.AddScore(2, 1);
|
|
}
|
|
fsm.Hide_Unlight_DisableInteraction("碘伏棉签1");
|
|
fsm.PlayClip("消毒瓶塞2", () => {
|
|
fsm.ShowTipBtn(() => {
|
|
fsm.Show_Light_EnableInteraction("碘伏棉签2",true);
|
|
fsm.ShowArrow("拖拽碘伏棉签", "碘伏棉签2", 0, 0, 5, true);
|
|
},0);
|
|
fsm.ShowArrow("拖拽碘伏棉签", "碘伏棉签2", 0, 0, 5);
|
|
fsm.Show_Light_EnableInteraction("碘伏棉签2");
|
|
fsm.PlayBgm(1);
|
|
fsm.ShowTip(1);
|
|
});
|
|
}
|
|
if (obj.name == "碘伏棉签2")
|
|
{
|
|
fsm.AddScore(1, 2);
|
|
fsm.Unlight_DisableInteraction("瓶塞高亮处");
|
|
fsm.InteractionTrigger("瓶塞高亮处", null);
|
|
fsm.Hide_Unlight_DisableInteraction("碘伏棉签2");
|
|
fsm.PlayClip("消毒瓶塞3", () => {
|
|
fsm.nextState = true;
|
|
});
|
|
}
|
|
});
|
|
}
|
|
public override void OnStateExit()
|
|
{
|
|
base.OnStateExit();
|
|
fsm.nextState = false;
|
|
}
|
|
}
|
|
}
|