修复第一次切换动画时会发生动画冲突

This commit is contained in:
ZouJin 2023-03-07 19:13:07 +11:00
parent c5fdab3647
commit cf79bd2f8c

View File

@ -84,7 +84,14 @@ namespace VPet_Simulator.Core
} }
return false; return false;
} }
/// <summary>
/// 显示关机动画
/// </summary>
public void DisplayClose(Action EndAction)
{
CountNomal++;
Display(GraphCore.GraphType.Shutdown, EndAction);
}
/// <summary> /// <summary>
/// 显示摸头情况 /// 显示摸头情况
/// </summary> /// </summary>
@ -1080,6 +1087,7 @@ namespace VPet_Simulator.Core
DisplayType = graph.GraphType; DisplayType = graph.GraphType;
if (PetGrid.Child == graph.This) if (PetGrid.Child == graph.This)
{ {
petgridcrlf = true;
((IGraph)(PetGrid2.Child)).Stop(true); ((IGraph)(PetGrid2.Child)).Stop(true);
Dispatcher.Invoke(() => Dispatcher.Invoke(() =>
{ {
@ -1091,6 +1099,7 @@ namespace VPet_Simulator.Core
} }
else if (PetGrid2.Child == graph.This) else if (PetGrid2.Child == graph.This)
{ {
petgridcrlf = false;
((IGraph)(PetGrid.Child)).Stop(true); ((IGraph)(PetGrid.Child)).Stop(true);
Dispatcher.Invoke(() => Dispatcher.Invoke(() =>
{ {
@ -1101,8 +1110,6 @@ namespace VPet_Simulator.Core
return; return;
} }
graph.Run(EndAction); graph.Run(EndAction);
if (petgridcrlf) if (petgridcrlf)
{ {
((IGraph)(PetGrid.Child)).Stop(true); ((IGraph)(PetGrid.Child)).Stop(true);