本文整理汇总了C#中Route.GetOption2方法的典型用法代码示例。如果您正苦于以下问题:C# Route.GetOption2方法的具体用法?C# Route.GetOption2怎么用?C# Route.GetOption2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Route
的用法示例。
在下文中一共展示了Route.GetOption2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PostPlanRouteCallback
public static void PostPlanRouteCallback(Route r, string routeType, string result)
{
try
{
if ((r.Follower != null) && (r.Follower.Target is Sim))
{
if (((r.GetOption(Route.RouteOption.EnableSubwayPlanning)) || (r.GetOption2(Route.RouteOption2.EnableHoverTrainPlanning))) && !r.GetOption(Route.RouteOption.EnableUFOPlanning))
{
CheckAndUpdateRouteForPortals(r);
}
if (((routeType == "Replan") || (routeType == "ReplanFromPoint")) && r.GetOption(Route.RouteOption.PlanUsingStroller))
{
r.SetOption(Route.RouteOption.ReplanUsingStroller, false);
}
if (RoutingComponent.sPostPlanProfileCallback != null)
{
RoutingComponent.sPostPlanProfileCallback(r, routeType, result);
}
}
}
catch (Exception e)
{
Common.Exception("PostPlanRouteCallback", e);
}
}
示例2: DoRoute
public static bool DoRoute(RoutingComponent ths, Route r)
{
Sim owner = ths.Owner as Sim;
if ((!r.ExecutionFromNonSimTaskIsSafe && (owner != null)) && (Simulator.CurrentTask != ths.Owner.ObjectId))
{
Simulator.CurrentTask.ObjectFromId<GameObject>();
return false;
}
IBoat boat = ths.Owner as IBoat;
if (ths.RoutingParent != null)
{
if (!(ths.RoutingParent is IBoat) || (r.GetOption2(Route.RouteOption2.EndAsBoat) && (!r.PlanResult.Succeeded() || !RoutingComponent.PlannedRouteHasNonBoatSubpath(r))))
{
// Custom
if (ths.RoutingParent.RoutingComponent is CarRoutingComponent)
{
return CarRoutingComponentEx.DoRoute(ths.RoutingParent.RoutingComponent as CarRoutingComponent, r);
}
else
{
return ths.RoutingParent.RoutingComponent.DoRoute(r);
}
}
}
else if (((boat != null) && r.PlanResult.Succeeded()) && (!r.GetOption2(Route.RouteOption2.EndAsBoat) || RoutingComponent.PlannedRouteHasNonBoatSubpath(r)))
{
Sim driver = boat.GetDriver();
if (driver != null)
{
return driver.RoutingComponent.DoRoute(r);
}
}
Common.StringBuilder msg = new Common.StringBuilder("RoutingComponentEx:DoRoute" + Common.NewLine);
if (owner != null)
{
msg += Common.NewLine + owner.FullName + Common.NewLine;
}
ths.mRouteActions.Clear();
bool routeSuccess = true;
try
{
RouteAction.FailureExplanation explanation = RouteAction.FailureExplanation.None;
RoutingComponent.mnNumDoRouteCalls += (ulong)0x1L;
if (r.PlanResult.Succeeded())
{
ths.OnAboutToStartFollowingRoute(r);
if (r.PlanResult.Succeeded())
{
ths.PushActionsForRoute(r, r);
if (owner != null)
{
owner.PushBackpackPostureIfNecessary();
owner.PushCanePostureIfNecessary();
owner.PushJetpackPostureIfNecessary();
}
}
else
{
routeSuccess = false;
}
}
else
{
routeSuccess = false;
}
msg.Append("A");
if (!routeSuccess)
{
explanation |= RouteAction.FailureExplanation.InitialPlanFailure;
LogFailure(ths.Owner, RouteAction.FailureExplanation.InitialPlanFailure, r.PlanResult, "Initial Path Plan Failure (WILL NOT play route fail)");
r.SetRouteActionResult(0x2);
return false;
}
msg.Append("B");
int failures = 0;
if ((ths.RoutingParent != null) && (ths.RoutingParent is IBoat))
{
ths.UpdateDynamicFootprint(ths.RoutingParent as GameObject, false);
}
else
{
ths.UpdateDynamicFootprint(ths.Owner, false);
}
Vector3 originalPosition = ths.Owner.Position;
int loops = 0;
bool success = true;
Route processedPath = r;
bool isOutside = ths.Owner.IsOutside;
ths.mNumWaterEntriesThisRoute = 0;
while (ths.mRouteActions.Count != 0x0)
//.........这里部分代码省略.........