本文整理汇总了C#中Sim.GetDistanceToObject方法的典型用法代码示例。如果您正苦于以下问题:C# Sim.GetDistanceToObject方法的具体用法?C# Sim.GetDistanceToObject怎么用?C# Sim.GetDistanceToObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sim
的用法示例。
在下文中一共展示了Sim.GetDistanceToObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTest
public static bool OnTest(Sim actor, Sim target, ActiveTopic topic, bool isAutonomous, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
try
{
//bool isAutonomous = Common.IsAutonomous(actor);
VaccinationSessionSituation situation = VaccinationSessionSituation.GetVaccinationSessionSituation(actor);
if (situation != null)
{
if (situation.IsInIgnoreList(target))
{
return false;
}
else if (!situation.IsInSeekersList(target) && !situation.IsInInterruptedList(target))
{
return false;
}
else if (isAutonomous && (actor.GetDistanceToObject(target) > AutographSessionSituation.MaxDistanceForAutonomousSign))
{
return false;
}
return true;
}
else
{
FreeClinicSessionSituation freeClinicSessionSituation = FreeClinicSessionSituation.GetFreeClinicSessionSituation(actor);
if (freeClinicSessionSituation != null)
{
if (freeClinicSessionSituation.IsInIgnoreList(target))
{
return false;
}
else if (!freeClinicSessionSituation.IsInSeekersList(target) && !freeClinicSessionSituation.IsInInterruptedList(target))
{
return false;
}
else if (isAutonomous && (actor.GetDistanceToObject(target) > AutographSessionSituation.MaxDistanceForAutonomousSign))
{
return false;
}
}
else if (isAutonomous)
{
return false;
}
}
Medical medical = actor.Occupation as Medical;
return ((medical != null) && (medical.Level >= 3));
}
catch (ResetException)
{
throw;
}
catch (Exception e)
{
Common.Exception(actor, target, e);
return false;
}
}
示例2: OnAskedToGoSkinnyDipping
public static void OnAskedToGoSkinnyDipping(Sim actor, Sim target, string interaction, ActiveTopic topic, InteractionInstance i)
{
try
{
GreyedOutTooltipCallback greyedOutTooltipCallback = null;
Pool[] objects = actor.LotCurrent.GetObjects<Pool>();
float num = 0f;
Pool pool = null;
foreach (Pool pool2 in objects)
{
#region CHANGED
if (CanSkinnyDipAtLocation(actor, pool2.Position, ref greyedOutTooltipCallback))
#endregion
{
float distanceToObject = actor.GetDistanceToObject(pool2);
if ((pool == null) || (distanceToObject < num))
{
pool = pool2;
num = distanceToObject;
}
}
}
if (pool != null)
{
GetInPool entry = GetInPool.SkinnyDipSingleton.CreateInstance(pool, actor, i.GetPriority(), true, true) as GetInPool;
GetInPool pool4 = GetInPool.SkinnyDipSingleton.CreateInstance(pool, target, i.GetPriority(), true, true) as GetInPool;
entry.SkinnyDippingBuddyID = target.SimDescription.SimDescriptionId;
pool4.SkinnyDippingBuddyID = actor.SimDescription.SimDescriptionId;
actor.InteractionQueue.AddNext(entry);
target.InteractionQueue.AddNext(pool4);
}
}
catch (Exception e)
{
Common.Exception(actor, target, e);
}
}