本文整理汇总了C#中Route.Replan方法的典型用法代码示例。如果您正苦于以下问题:C# Route.Replan方法的具体用法?C# Route.Replan怎么用?C# Route.Replan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Route
的用法示例。
在下文中一共展示了Route.Replan方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoRouteWithFollowers
public static bool DoRouteWithFollowers(SimRoutingComponent ths, Route r, List<Sim> followers, GoHereWithSituation.OnFailBehavior failBehavior, Vector3 teleportLocation)
{
if ((followers != null) && (followers.Count != 0))
{
if (ths.OwnerSim.Autonomy.SituationComponent.InSituationOfType(typeof(GoHereWithSituation)))
{
return false;
}
bool flag = r.PlanResult.Succeeded();
if (!flag)
{
RidingPosture ridingPosture = ths.OwnerSim.RidingPosture;
if (ridingPosture != null)
{
ObjectGuid objectId = ridingPosture.Mount.ObjectId;
r.AddObjectToIgnoreForRoute(objectId);
r.Replan();
r.RemoveObjectToIgnoreForRoute(objectId);
flag = r.PlanResult.Succeeded();
}
}
if (flag)
{
InteractionInstance instance;
bool flag2 = false;
InteractionPriority priority = ths.OwnerSim.InheritedPriority();
// Custom
InteractionInstance entry = CreateGoHereWithInteractionInstance(ths, r, followers, priority, true, out instance, failBehavior, teleportLocation);
try
{
ths.mbAllowBikes = false;
if (instance != null)
{
entry.InstanceActor.InteractionQueue.Add(entry);
}
else
{
instance = entry;
}
InteractionInstance currentInteraction = ths.OwnerSim.CurrentInteraction;
currentInteraction.PartOfGoHereSituation = true;
instance.GroupId = currentInteraction.GroupId;
flag2 = instance.RunInteractionWithoutCleanup();
flag2 = flag2 && !entry.InstanceActor.HasExitReason(ExitReason.RouteFailed);
}
finally
{
ths.mbAllowBikes = true;
instance.Cleanup();
}
return flag2;
}
if ((ths.OwnerSim.IsInRidingPosture && (r.Follower.Target == ths.OwnerSim)) && (r.DoRouteFail && ths.mOwnerSim.CheckPlayRouteFailFrequency()))
{
ths.PlayRouteFailureIfAppropriate(null);
return false;
}
}
return ths.DoRoute(r);
}
示例2: DebugMsg
//.........这里部分代码省略.........
if (mOwnerSim.IsActiveSim)
{
Route.SetFadePriority(mOwnerSim.ObjectId, 0x186a3);
}
else if (mOwnerSim.IsInActiveHousehold)
{
Route.SetFadePriority(mOwnerSim.ObjectId, 0x186a2);
}
else
{
Route.SetFadePriority(mOwnerSim.ObjectId, 0x186a1);
}
while (true)
{
flag = false;
if (mbPushRequested)
{
if ((!(mOwnerSim.Posture is SittingInVehicle) && !(mOwnerSim.Posture is SittingInBoat)) && (mOwnerSim.RoutingComponent.RoutingParent == null))
{
try
{
MidRouteBePushed(r.ExecutionFromNonSimTaskIsSafe);
}
catch (ResetException)
{
throw;
}
catch (Exception e)
{
Common.Exception(routeSim, e);
}
r.Replan();
}
else
{
mbPushRequested = false;
}
continue;
}
StartPushImmunity(OnRouteStartedImmuneToPushesDuration);
flag = DoSingleRouteEx(r, true);
flag &= r.PlanResult.Succeeded();
if (mbPushRequested)
{
continue;
}
if (r.GetOption(Route.RouteOption.CheckForFootprintsNearGoals))
{
ObjectGuid guid = r.IsPointObstructedBySim(mOwnerSim.PositionOnFloor);
if (guid != ObjectGuid.InvalidObjectGuid)
{
ObjectGuid runningTargetId = ObjectGuid.InvalidObjectGuid;
if (((mOwnerSim.InteractionQueue != null) && (mOwnerSim.InteractionQueue.RunningInteraction != null)) && (mOwnerSim.InteractionQueue.RunningInteraction.Target != null))
{
runningTargetId = mOwnerSim.InteractionQueue.RunningInteraction.Target.ObjectId;
}
if ((guid != runningTargetId) && !PushSims(mOwnerSim.PositionOnFloor, 0.5f, false))
{
bool option = r.GetOption(Route.RouteOption.BlockedByPeople);
r.SetOption(Route.RouteOption.BlockedByPeople, true);