/// <summary> /// This is called when the path follower successful completes following a path. /// </summary> protected void OnFollowCompleted(Event <FollowCompletedEventPayload> eventArg) { FollowCompletedEventPayload payload = eventArg.EventData; if (payload.gameObject != gameObject) // event not for us { return; } // Play victory music :-) }
/// <summary> /// This is called when the path follower successful completes following a path. /// </summary> protected void OnFollowCompleted(Event <FollowCompletedEventPayload> eventArg) { FollowCompletedEventPayload payload = eventArg.EventData; if (payload.gameObject != gameObject) // event not for us { return; } FindPathToNextDestination(); }