本文整理汇总了C#中Lot.FindFrontDoor方法的典型用法代码示例。如果您正苦于以下问题:C# Lot.FindFrontDoor方法的具体用法?C# Lot.FindFrontDoor怎么用?C# Lot.FindFrontDoor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lot
的用法示例。
在下文中一共展示了Lot.FindFrontDoor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AttemptToFindSafeLocation
public static Vector3 AttemptToFindSafeLocation(Lot lot, bool isHorse)
{
if (lot == null) return Vector3.Invalid;
if (isHorse)
{
Mailbox mailbox = lot.FindMailbox();
if (mailbox != null)
{
return mailbox.Position;
}
else
{
Door frontDoor = lot.FindFrontDoor();
if (frontDoor != null)
{
int roomId = frontDoor.GetRoomIdOfDoorSide(CommonDoor.tSide.Front);
if (roomId != 0)
{
roomId = frontDoor.GetRoomIdOfDoorSide(CommonDoor.tSide.Back);
}
if (roomId == 0)
{
List<GameObject> objects = lot.GetObjectsInRoom<GameObject>(roomId);
if (objects.Count > 0)
{
return RandomUtil.GetRandomObjectFromList(objects).Position;
}
}
}
}
}
return lot.EntryPoint();
}
示例2: ExternalAllowPush
public static bool ExternalAllowPush(SimDescription sim, Lot lot)
{
if (lot != null)
{
bool allowed = false;
if (!lot.IsResidentialLot)
{
List<Door> portals = lot.GetObjectsInRoom<Door>(0);
foreach (Door obj in portals)
{
DoorPortalComponentEx.DoorSettings settings = GoHere.Settings.GetDoorSettings(obj.ObjectId, false);
if (settings != null && settings.IsSimAllowedThrough(sim.SimDescriptionId))
{
allowed = true;
break;
}
}
}
else
{
Door door = lot.FindFrontDoor();
if (door != null)
{
DoorPortalComponentEx.DoorSettings settings = GoHere.Settings.GetDoorSettings(door.ObjectId, false);
if (settings != null)
{
allowed = settings.IsSimAllowedThrough(sim.SimDescriptionId);
}
}
else
{
allowed = true;
}
}
if (!allowed) return allowed;
}
if (!sStoryProgressionAllowPushToLot.Valid) return true;
return sStoryProgressionAllowPushToLot.Invoke<bool>(new object[] { sim, lot });
}