29 lines
600 B
C#
29 lines
600 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using UnityEngine;
|
|
|
|
namespace Rokojori
|
|
{
|
|
|
|
[CreateAssetMenu( menuName = "Rokojori/Dialog/Player Choice" )]
|
|
public class PlayerChoice : DialogBlock
|
|
{
|
|
public Locale choiceLine = null;
|
|
public List<DialogOption> options = new List<DialogOption>();
|
|
|
|
public override async Task<DialogBlock> Run( IDialogDisplay display )
|
|
{
|
|
var answer = await display.Show( this );
|
|
var option = options[ answer.selectedOptionIndex ];
|
|
|
|
if ( option.action != null )
|
|
{
|
|
option.action.Execute();
|
|
}
|
|
|
|
return option.next;
|
|
}
|
|
}
|
|
|
|
}
|