93 lines
3.0 KiB
C#
93 lines
3.0 KiB
C#
using FSM;
|
|
using Unity.VisualScripting;
|
|
using UnityEngine;
|
|
using ZXKFramework;
|
|
namespace DongWuYiXue.DaoNiaoShu
|
|
{
|
|
public class ChongXiBaoPiQiangState : FsmState<FSMManager>
|
|
{
|
|
bool isTui = false;
|
|
float tuiValue = 0;
|
|
HardwareControl ZhuSheQi;
|
|
public override void OnStateEnter()
|
|
{
|
|
base.OnStateEnter();
|
|
this.Log("进入冲洗包皮腔状态");
|
|
isTui = false;
|
|
tuiValue = 0;
|
|
ZhuSheQi = fsm.Get("20ml注射器放置后").GetComponent<HardwareControl>();
|
|
ZhuSheQi.length = 0f;
|
|
fsm.Show("20ml注射器");
|
|
fsm.ShowCamera("冲洗包皮腔1_Camera");
|
|
fsm.ShowTip(0);
|
|
fsm.PlayBgm(0);
|
|
fsm.Light_EnableInteraction("20ml注射器");
|
|
fsm.ShowArrow("点击注射器", "20ml注射器");
|
|
fsm.ShowTipBtn(() =>
|
|
{
|
|
fsm.Light_EnableInteraction("20ml注射器", true);
|
|
fsm.ShowArrow("点击注射器", "20ml注射器", 0, 0, 5, true);
|
|
}, 2);
|
|
fsm.InteractionDown("20ml注射器", c =>
|
|
{
|
|
fsm.HideTipBtn();
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(4, 0);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
fsm.AddScore(3, 0);
|
|
}
|
|
fsm.HideArrow();
|
|
fsm.Unlight_DisableInteraction("20ml注射器");
|
|
fsm.Hide("20ml注射器");
|
|
fsm.ShowCamera("冲洗包皮腔2_Camera");
|
|
fsm.Show("20ml注射器放置后");
|
|
isTui = true;
|
|
});
|
|
}
|
|
public override void OnStateStay()
|
|
{
|
|
base.OnStateStay();
|
|
if (isTui)
|
|
{
|
|
tuiValue += .0005f;
|
|
fsm.PlayClip("冲洗包皮腔_TimeLine", null, tuiValue);
|
|
//ZhuSheQi.length += .0005f;
|
|
//ZhuSheQi.animName = "注射器打入";
|
|
//ZhuSheQi.Move();
|
|
}
|
|
if (isTui && Input.GetKeyDown(KeyCode.L))
|
|
{
|
|
//ZhuSheQi.length = 1.0f;
|
|
//ZhuSheQi.animName = "注射器打入";
|
|
//ZhuSheQi.Move();
|
|
tuiValue = 1.0f;
|
|
fsm.PlayClip("冲洗包皮腔_TimeLine", null, tuiValue);
|
|
}
|
|
if (tuiValue >= 1.0f)
|
|
{
|
|
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
|
|
{
|
|
fsm.AddScore(5, 1);
|
|
}
|
|
if (fsm.main_gameModel.modeType == ModeType.KaoHe)
|
|
{
|
|
fsm.AddScore(5, 1);
|
|
}
|
|
isTui = false;
|
|
fsm.nextState = true;
|
|
}
|
|
}
|
|
public override void OnStateExit()
|
|
{
|
|
base.OnStateExit();
|
|
fsm.HideTipBtn();
|
|
isTui = false;
|
|
fsm.Hide("20ml注射器放置后");
|
|
fsm.nextState = false;
|
|
}
|
|
}
|
|
}
|