2025-09-11 09:06:04 +08:00

78 lines
2.4 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.InteractionDown("20ml注射器", c =>
{
if (fsm.main_gameModel.modeType == ModeType.ShiXun)
{
fsm.AddScore(4, 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(4, 0);
}
isTui = false;
fsm.nextState = true;
}
}
public override void OnStateExit()
{
base.OnStateExit();
isTui = false;
fsm.Hide("20ml注射器放置后");
fsm.nextState = false;
}
}
}