Created
February 9, 2016 10:10
-
-
Save thefuntastic/070a4c7d12ea413a45e7 to your computer and use it in GitHub Desktop.
Modifications to State Engine in order to enable OnCollisionEnter State calls
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
//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