Created
March 11, 2018 19:42
-
-
Save maxp-edcast/b67df7c06879056adb2e820958aa9e98 to your computer and use it in GitHub Desktop.
Dialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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