diff --git a/Scripts/Dialog/DialogController.cs b/Scripts/Dialog/DialogController.cs index 75c8e0e..6302e29 100644 --- a/Scripts/Dialog/DialogController.cs +++ b/Scripts/Dialog/DialogController.cs @@ -569,6 +569,18 @@ public CancellationToken GetDialogToken() return dialogTokenSource.Token; } + public async UniTask ClearStateAsync(string userId = null) + { + if (requestProcessor is LocalRequestProcessor) + { + if (string.IsNullOrEmpty(userId)) + { + userId = GetClientIdDefault(); + } + await ((LocalRequestProcessor)requestProcessor).ClearStateAsync(userId); + } + } + private void Update() { // Control mute diff --git a/Scripts/Dialog/Processor/LocalRequestProcessor.cs b/Scripts/Dialog/Processor/LocalRequestProcessor.cs index 274ba6a..ff96acb 100644 --- a/Scripts/Dialog/Processor/LocalRequestProcessor.cs +++ b/Scripts/Dialog/Processor/LocalRequestProcessor.cs @@ -151,5 +151,10 @@ public virtual async UniTask ProcessRequestAsync(Request request, Canc throw ex; } } + + public virtual async UniTask ClearStateAsync(string userId) + { + await StateStore.DeleteStateAsync(userId); + } } }