Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tkuebler/stateDSL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

stateDSL

An event driven FSM DSL for Unity and C#.

(note: use the wiki for brainstorming ideas if you want to contribute to the DSL design discussion)

Objective

Create a trivial to use FSM DSL that can be embedded in a C# Unity environment.

Design Goals ( Wish List ):

  1. Supports Unity's 'script per behavior / gameobject' pattern. ie. easy to use with standard programming practice in unity.
  2. Co-habits regular C# game behavior scripts.
  3. Is terse and easy to read without documentation. It should be completely obvious from example.
  4. Explict without boilerplate.
  5. Support MonoBehavior objects and be main thread safe/aware.
  6. Supports user provided events
  7. Provides hooks into unity's event framework
  8. Unity package with examples.

Optional (Unicorns Eating Pie in Sky):

  1. SubState Machines at any node.
  2. Unity Editor Graphical Viewer
    1. Shows your FSMs across all your unity scripts in easyt to read graph format.
    2. Shows your current transtions and states during play mode.
  3. Support for javascript.
  4. Support for delegate subscription to events ( faster than unity's events )

##Example:

	// script #1
	FSM Example {
	
		state default {
			on_entry { // C# code here }
			exit { // C# code here }
		
			// catchall events
			on_event {
				// C# code here
				....
				state two; // transition to state 2
			}
		}
	
		state two {
			entry { // your C# }
			exit { // your C# }
		
			// catch event A
			event A {
				// C# code here
				state three;
			}
			// catch all other events
			event {
				// C# code here
			}
	}

	// Script #2
	FSM Example {
		state three {
			entry { // your C# }
			exit { // your C# }
			event A {
				// C# code
				state two
			}
			event B {
				// C# code
				state default;
			}
			event C { // C# code }
		}

Footnotes:

About

FSM DSL for C# and Unity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors