Exemple #1
0
    Intersection updateLastIntersectedFloor(Floor floor)
    {
        if (floor == null) {
            return Intersection.NotIntersected ();
        }

        Intersection intersection = floor.GetIntersection (transform.position);
        if (intersection.IsIntersected) {
            if (Vector3.Distance (intersection.IntersectPosition, transform.position) < 2f) {
                lastIntersectedFloor = floor;
            } else {
                return Intersection.NotIntersected ();
            }
        }
        return intersection;
    }