public static void AddAnimation(string Name, Action Animation, int FrameNumber = 1, float TotalTime = 0.0f, Action Callback = null, Action Preparation = null) { PThread.Async(() => { int ID = IDCount++; PUIManager.RegisterAnimation(ID); // PLogger.Log("注册动画 " + Name + " #" + ID); PThread.WaitUntil(() => PUIManager.IsAvailable(ID)); // PLogger.Log("开始动画 " + Name + " #" + ID); PUIManager.AddNewUIAction(string.Empty, () => { Preparation?.Invoke(); }, ID); PThread.Repeat(() => { PUIManager.AddNewUIAction(string.Empty, Animation, ID); }, FrameNumber, TotalTime); PUIManager.AddNewUIAction(string.Empty, () => { }, ID, true); // PLogger.Log("结束动画 " + Name + " #" + ID); Callback?.Invoke(); }); }