Skip to content

Instantly share code, notes, and snippets.

@thefuntastic
Created February 9, 2016 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefuntastic/070a4c7d12ea413a45e7 to your computer and use it in GitHub Desktop.
Save thefuntastic/070a4c7d12ea413a45e7 to your computer and use it in GitHub Desktop.
Modifications to State Engine in order to enable OnCollisionEnter State calls
//Line ~138
//Bind the State Methods
case "OnCollisionEnter":
targetState.OnCollisionEnter = CreateDelegate<Action<Collision>>(methods[i], entity);
break;
//Line ~308
//Make sure state engine recieves collision events.
void OnCollisionEnter(Collision collision)
{
if(currentState != null && !IsInTransition)
{
currentState.OnCollisionEnter(collision);
}
}
//Line ~366
//Define the action on our StateMapping object
public Action<Collision> OnCollisionEnter = StateEngine.DoNothingCollision;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment