using FSM; using Unity.VisualScripting.FullSerializer; using UnityEngine; using ZXKFramework; namespace DongWuYiXue.DaoNiaoShu { public class ChaGuanState : FsmState { bool isChaGuan = false; float chaGuanValue = 0; public override void OnStateEnter() { base.OnStateEnter(); this.Log("进入插管状态"); isChaGuan = true; chaGuanValue = 0; fsm.ShowCamera("插管1_Camera"); fsm.ShowTip(0); fsm.PlayBgm(0); fsm.PlayClip("插管_TimeLine", () => { }); } public override void OnStateStay() { base.OnStateStay(); if (isChaGuan) { chaGuanValue += .0005f; fsm.PlayClip("插管_TimeLine", null, chaGuanValue); } if (isChaGuan && Input.GetKeyDown(KeyCode.L)) { chaGuanValue = 1.0f; fsm.PlayClip("插管_TimeLine", null, chaGuanValue); } if (chaGuanValue >= 1.0f) { if (fsm.main_gameModel.modeType == ModeType.ShiXun) { fsm.AddScore(10, 0); } isChaGuan = false; fsm.nextState = true; } } public override void OnStateExit() { base.OnStateExit(); isChaGuan = false; fsm.nextState = false; } } }