Skip to content

v21/unity-tracery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a (currently very barebones) port of Kate Compton's Tracery text generation grammar tool to Unity (and by extension C# in general).

It's used like this:

var tracerySource = "{"origin":["one#symbol#","two#symbol#","three"],"symbol":"s"}"
var grammar = new TraceryGrammar(tracerySource);
Debug.Log(grammar.Generate());
Debug.Log(grammar.Generate());

which would give an output something like :

ones
three

You can also specify the random seed when calling Generate, to make output repeatable:

Debug.Log(grammar.Generate(123456));
Debug.Log(grammar.Generate(123456));
Debug.Log(grammar.Generate(123456));
Debug.Log(grammar.Generate(123456));

ones
ones
ones
ones

There is currently no support for modifiers, variables, or the fancy rich-object stuff that's been added recently.

About

A port of Kate Compton's Tracery to C#/Unity3d

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages