Merge branch 'dev' of http://8.153.108.90:3000/YD/Wpf_AiSportsMicrospace into dev
This commit is contained in:
commit
183d463fba
@ -243,7 +243,6 @@ namespace Wpf_AiSportsMicrospace.Views
|
||||
|
||||
private async void StartCountdown(int start = 3)
|
||||
{
|
||||
|
||||
_mainWin.ShowCountDownAnimation();
|
||||
//_currentCountdown = start;
|
||||
Utils.PlayBackgroundMusic("countdown_3.mp3", false);
|
||||
@ -363,6 +362,7 @@ namespace Wpf_AiSportsMicrospace.Views
|
||||
_groupJumpRopeContext.Sports.Add(sport);
|
||||
}
|
||||
}
|
||||
|
||||
//private void UpdateCircleCounts(List<Human> humans)
|
||||
//{
|
||||
// if (humans == null || humans.Count == 0)
|
||||
|
||||
@ -201,18 +201,9 @@ namespace Wpf_AiSportsMicrospace.Views.JumpRope
|
||||
switch (rightWaving)
|
||||
{
|
||||
case (int)WavingAction.FirstHand:
|
||||
if (!_isCountdownStarted)
|
||||
{
|
||||
StartCountdown(3);
|
||||
}
|
||||
|
||||
break;
|
||||
case (int)WavingAction.Raising:
|
||||
//UpdateCountdown();
|
||||
break;
|
||||
case (int)WavingAction.RaiseHand:
|
||||
//FinishCountdown();
|
||||
//_currentGameState = GameState.Running;
|
||||
_currentGameState = GameState.Running;
|
||||
StartCountdown(3);
|
||||
_isCountdownStarted = true; // 倒计时开始,停止左手检测
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,16 +210,10 @@ namespace Views.SquatFu
|
||||
switch (rightWaving)
|
||||
{
|
||||
case (int)WavingAction.FirstHand:
|
||||
_currentGameState = GameState.Running;
|
||||
StartCountdown(3);
|
||||
_isCountdownStarted = true; // 倒计时开始,停止左手检测
|
||||
break;
|
||||
//case (int)WavingAction.Raising:
|
||||
// UpdateCountdown();
|
||||
// break;
|
||||
//case (int)WavingAction.RaiseHand:
|
||||
// FinishCountdown();
|
||||
// _currentGameState = GameState.Running; // 倒计时完成 → 游戏开始
|
||||
// break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -227,19 +221,19 @@ namespace Views.SquatFu
|
||||
case GameState.Running: // 游戏进行中
|
||||
UpdateCircleCounts(humans);
|
||||
break;
|
||||
case GameState.Finished: // 游戏结束
|
||||
int leftWave = sportOperate.VerifyLeftWavingAction(humans);
|
||||
if (leftWave == 5)
|
||||
{
|
||||
_mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
|
||||
_mainWin.WebcamClient.StopExtract();
|
||||
//case GameState.Finished: // 游戏结束
|
||||
// int leftWave = sportOperate.VerifyLeftWavingAction(humans);
|
||||
// if (leftWave == 5)
|
||||
// {
|
||||
// _mainWin.HumanFrameUpdated -= OnHumanFrameUpdated;
|
||||
// _mainWin.WebcamClient.StopExtract();
|
||||
|
||||
// 举左手逻辑,例如结束动画或退出
|
||||
var newPage = new Home();
|
||||
_mainWin?.SwitchPageWithMaskAnimation(newPage, true);
|
||||
return; // 提前退出
|
||||
}
|
||||
break;
|
||||
// // 举左手逻辑,例如结束动画或退出
|
||||
// var newPage = new Home();
|
||||
// _mainWin?.SwitchPageWithMaskAnimation(newPage, true);
|
||||
// return; // 提前退出
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user