Skip to content

Instantly share code, notes, and snippets.

@maxp-edcast
Created March 11, 2018 19:42
Show Gist options
  • Save maxp-edcast/b67df7c06879056adb2e820958aa9e98 to your computer and use it in GitHub Desktop.
Save maxp-edcast/b67df7c06879056adb2e820958aa9e98 to your computer and use it in GitHub Desktop.
Dialog
using Fluent;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
public class RobotDialog : FluentScript
{
public override FluentNode Create()
{
return (
Show() *
Say (Intro ())
);
}
public FluentNode Say (List<string> phrases) {
IEnumerable<FluentNode> nodes = phrases.Select ((string phrase) => {
return (FluentNode) Write (0, phrase).WaitForButton ();
});
return nodes.Aggregate ((FluentNode a, FluentNode b) => {
return a * b;
});
}
public List<string> Intro () {
return new List<string> {
"Hi.",
"I'm sure you were put here for a reason.",
"I don't know what it is, but no matter."
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment