private void OnMoveStateEndEvent(object sender, MoveStateEndArgs e) { if (e.GetType == typeof(AttackNode)) { // Check which attack it was Debug.Log("Attack that ended is: " + ((AttackNode)sender).ID); } myState = CharState.Idle; currentNode = null; }
// Protected OnMoveStateEvent raises the event by invoking // the delegates that have subscribed to the class's event protected virtual void OnMoveStateEvent(MoveStateEndArgs e) { MoveStateEndEventHandler handler = MoveStateEvent; if (handler != null) { handler(this, e); } // Deactivate the node because the timer has run out EndAttack(); }