unity-roject-test/Assets/Scripts/Rokojori/Dialog/DialogList.cs

30 lines
857 B
C#
Raw Normal View History

2026-09-25 20:32:02 +00:00
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
namespace Rokojori
{
// A reusable, self-contained run of blocks, authored and moved around as one
// asset. Assumption pending confirmation: "blocks" is a flat linear sequence
// of content nodes (DialogLine, CommentBlock, ...) - each child's own "next"
// is ignored while inside the list, since ordering here is authoritative.
// Once the list is exhausted, control hands off to this DialogList's "next".
[CreateAssetMenu( menuName = "Rokojori/Dialog/Dialog List" )]
public class DialogList : DialogBlock
{
public List<DialogBlock> blocks = new List<DialogBlock>();
public override async Task<DialogBlock> Run( IDialogDisplay display )
{
for ( int i = 0; i < blocks.Count; i++ )
{
await blocks[ i ].Run( display );
}
return next;
}
}
}