本文整理汇总了C#中Job.CreateAndAddChildJob方法的典型用法代码示例。如果您正苦于以下问题:C# Job.CreateAndAddChildJob方法的具体用法?C# Job.CreateAndAddChildJob怎么用?C# Job.CreateAndAddChildJob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Job
的用法示例。
在下文中一共展示了Job.CreateAndAddChildJob方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitiateCourseAroundObstacleTo
protected void InitiateCourseAroundObstacleTo(Vector3 location) {
D.Log("Initiating obstacle avoidance course. Distance to destination = {0}.", Vector3.Distance(Data.Position, location));
if (_pilotJob != null && _pilotJob.IsRunning) {
_pilotJob.Kill();
}
Vector3 waypointAroundObstacle = GetWaypointAroundObstacleTo(location);
_pilotJob = new Job(EngageHomingCourseTo(waypointAroundObstacle), true);
_pilotJob.CreateAndAddChildJob(EngageHomingCourseToTarget());
}
示例2: InitiateCourseAroundObstacleTo
private void InitiateCourseAroundObstacleTo(Vector3 location) {
D.Log("{0} plotting course to avoid obstacle inroute to location {1}. Distance to location: {2}.", _fleet.FullName, location, Vector3.Distance(_data.Position, location));
if (_pilotJob != null && _pilotJob.IsRunning) {
_pilotJob.Kill();
}
Vector3 waypointAroundObstacle = GetWaypointAroundObstacleTo(location);
_pilotJob = new Job(EngageDirectCourseTo(waypointAroundObstacle), true);
_pilotJob.CreateAndAddChildJob(EngageDirectCourseToTarget());
}
示例3: InitiateCourseAroundObstacleTo
private void InitiateCourseAroundObstacleTo(Vector3 location) {
D.Log("{0} initiating course to avoid obstacle to {1}. Distance: {2}.", _ship.FullName, location, Vector3.Distance(_data.Position, location));
DisengageAutoPilot(); // can be called while already engaged
// even if this is an obstacle that has appeared on the way to another obstacle avoidance waypoint, go around it, then try direct to target
Vector3 waypointAroundObstacle = GetWaypointAroundObstacleTo(location);
_pilotJob = new Job(EngageDirectCourseTo(waypointAroundObstacle), true);
_pilotJob.CreateAndAddChildJob(EngageDirectCourseToTarget());
}