当前位置: 首页>>代码示例>>C#>>正文


C# Lot.FindFrontDoor方法代码示例

本文整理汇总了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();
        }
开发者ID:Robobeurre,项目名称:NRaas,代码行数:36,代码来源:Instantiation.cs

示例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 });
        }
开发者ID:Chain-Reaction,项目名称:NRaas,代码行数:42,代码来源:GoHere.cs


注:本文中的Lot.FindFrontDoor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。