/// <summary>
        /// Finds the interior door that is closest to ground level and farthest from the center of the building.
        /// </summary>
        /// <param name="lowestDoorPositionOut">Position of lowest door in scene.</param>
        /// <param name="lowestDoorNormalOut">Normal vector of lowest door in scene.</param>
        /// <returns>True if successful. False if no doors are found.</returns>
        public bool FindLowestOuterInteriorDoor(out Vector3 lowestDoorPositionOut, out Vector3 lowestDoorNormalOut)
        {
            lowestDoorPositionOut = lowestDoorNormalOut = Vector3.zero;
            DaggerfallStaticDoors interiorDoors = GetComponent <DaggerfallStaticDoors>();

            if (!interiorDoors)
            {
                return(false);
            }

            if (interiorDoors.FindLowestOutermostDoor(-1, out lowestDoorPositionOut, out int doorIndex))
            {
                lowestDoorNormalOut = interiorDoors.GetDoorNormal(doorIndex);
                return(true);
            }

            return(false);
        }
Пример #2
0
        public bool FindClosestInteriorDoor(Vector3 playerPos, out Vector3 closestDoorPositionOut, out Vector3 closestDoorNormalOut)
        {
            closestDoorPositionOut = closestDoorNormalOut = Vector3.zero;
            DaggerfallStaticDoors interiorDoors = GetComponent <DaggerfallStaticDoors>();

            if (!interiorDoors)
            {
                return(false);
            }

            int doorIndex;

            if (interiorDoors.FindClosestDoorToPlayer(playerPos, -1, out closestDoorPositionOut, out doorIndex))
            {
                closestDoorNormalOut = interiorDoors.GetDoorNormal(doorIndex);
                return(true);
            }

            return(false);
        }