30 lines
901 B
C#
30 lines
901 B
C#
|
|
using System;
|
||
|
|
using System.Threading.Tasks;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace Rokojori
|
||
|
|
{
|
||
|
|
|
||
|
|
// The UI-facing singleton and the only entry point for running a dialog.
|
||
|
|
// Can be called directly (menus, cutscenes, ...) or from a DialogPhase.
|
||
|
|
public class DialogManager : MonoBehaviour, IDialogDisplay
|
||
|
|
{
|
||
|
|
public static DialogManager instance => Unique<DialogManager>.Get();
|
||
|
|
|
||
|
|
public async Task StartDialog( DialogBlock start )
|
||
|
|
{
|
||
|
|
var processor = DialogProcessor.Create( this );
|
||
|
|
await processor.Run( start );
|
||
|
|
}
|
||
|
|
|
||
|
|
// Called by DialogProcessor when a block needs to be shown. UI wiring
|
||
|
|
// (text, portraits, choice buttons) isn't built yet - Assets/UI is still
|
||
|
|
// empty - so this intentionally fails loudly instead of pretending to work.
|
||
|
|
public Task<DialogAnswer> Show( DialogBlock block )
|
||
|
|
{
|
||
|
|
throw new NotImplementedException( "DialogManager UI wiring is not implemented yet." );
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|