This commit is contained in:
CortexCore
2025-03-03 18:43:55 +08:00
parent 54f40090c9
commit 4402ae533b
32 changed files with 337 additions and 73 deletions

View File

@@ -1,6 +1,8 @@
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading;
using Cysharp.Threading.Tasks;
namespace Net.Project.B.Dialogue
{
@@ -33,7 +35,15 @@ namespace Net.Project.B.Dialogue
/// 等待对话完成
/// </summary>
/// <returns></returns>
TaskAwaiter GetAwaiter();
CancellationTokenAwaitable.Awaiter GetAwaiter();
/// <summary>
/// 跳过对话
/// </summary>
public CancellationTokenSource CancellationTokenSource { get; set; }
/// <summary>
/// 元对象
/// </summary>
public object MetaObject { get; set; }
}
/// <summary>
/// 对话选择
@@ -64,10 +74,9 @@ namespace Net.Project.B.Dialogue
public int ActorIdentity { get; set; }
public string Text { get; set; }
public string VoicePath { get; set; }
public TaskAwaiter GetAwaiter()
{
throw new System.NotImplementedException();
}
public CancellationTokenAwaitable.Awaiter GetAwaiter() => CancellationTokenSource.Token.WaitUntilCanceled().GetAwaiter();
public CancellationTokenSource CancellationTokenSource { get; set; }
public object MetaObject { get; set; }
}
public struct DialogueChoice:IDialogueChoice
{