using System; using Cysharp.Threading.Tasks; using SLSFramework.General; using UnityEngine; namespace SLSFramework.General { /// 等待指定秒数后在控制台输出一条信息。 public class Cmd_WaitAndLog : CommandBase { private readonly float duration; private readonly string message; public Cmd_WaitAndLog(float duration, string message) { this.duration = duration; this.message = message; } protected override async UniTask ExecuteAsync(CommandContext outerContext) { await UniTask.Delay(TimeSpan.FromSeconds(duration)); Debug.Log($"[Cmd_WaitAndLog] 等待 {duration} 秒后... 输出: '{message}'"); } } }