From c23eb52bc23576e2ca1afaeab77d6b848996d6da Mon Sep 17 00:00:00 2001 From: ZouJin Date: Sun, 3 Sep 2023 17:23:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A3=9F=E7=89=A9(=E5=A4=B9?= =?UTF-8?q?=E5=B1=82)=E5=8A=A8=E7=94=BB=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E4=BD=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Graph/FoodAnimation.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/VPet-Simulator.Core/Graph/FoodAnimation.cs b/VPet-Simulator.Core/Graph/FoodAnimation.cs index 151f9ea..4936c9b 100644 --- a/VPet-Simulator.Core/Graph/FoodAnimation.cs +++ b/VPet-Simulator.Core/Graph/FoodAnimation.cs @@ -142,8 +142,8 @@ namespace VPet_Simulator.Core IsVisiable = false; else {//1,2: Margin X,Y - MarginWI = new Thickness(double.Parse(strs[1]), double.Parse(strs[2]), 0, 0); Width = double.Parse(strs[3]);//3:Width + MarginWI = new Thickness(double.Parse(strs[1]), double.Parse(strs[2]), 0, 0); if (strs.Length > 4) { Rotate = double.Parse(strs[4]);//Rotate @@ -165,8 +165,9 @@ namespace VPet_Simulator.Core This.Visibility = Visibility.Visible; This.Margin = MarginWI; This.LayoutTransform = new RotateTransform(Rotate); - This.Opacity = 1; + This.Opacity = Opacity; This.Width = Width; + This.Height = Width; } else { @@ -192,6 +193,7 @@ namespace VPet_Simulator.Core //parent.endwilldo = () => parent.Dispatcher.Invoke(Hidden); //parent.Dispatcher.Invoke(Hidden); parent.PlayState = false; + //等待其他两个动画完成 if (parent.DoEndAction) EndAction?.Invoke();//运行结束动画时事件 parent.StopAction?.Invoke(); @@ -280,11 +282,11 @@ namespace VPet_Simulator.Core var t1 = FL?.Run(FoodGrid.Front); var t2 = BL?.Run(FoodGrid.Back); FoodGrid.Food.Source = image; - Task.Run(() => Animations[0].Run(FoodGrid.Food, EndAction)); if (t1 != null) - Task.Run(t1.Start); + t1.Start(); if (t2 != null) - Task.Run(t2.Start); + t2.Start(); + Task.Run(() => Animations[0].Run(FoodGrid.Food, EndAction)); }); }