コード例 #1
0
    // Token: 0x0600490B RID: 18699 RVA: 0x00116868 File Offset: 0x00114A68
    internal bool Internal_RaycastRef(Ray ray, ref global::UIHotSpot.Hit hit)
    {
        float         num;
        float         num2;
        IntersectHint intersectHint = Intersect3D.RayCircleInfiniteForward(ray, this.center, this.radius, ref num, ref num2);

        switch (intersectHint)
        {
        case 1:
        case 2:
        case 3:
            hit.distance = Mathf.Min(num, num2);
            if (hit.distance < 0f && (hit.distance = Mathf.Max(num, num2)) < 0f)
            {
                return(false);
            }
            hit.point  = ray.GetPoint(hit.distance);
            hit.normal = Vector3.Normalize(hit.point - this.center);
            return(true);

        default:
            Debug.Log(intersectHint, this);
            return(false);
        }
    }
コード例 #2
0
ファイル: UISphereHotSpot.cs プロジェクト: sknchan/LegacyRust
    internal bool Internal_RaycastRef(Ray ray, ref UIHotSpot.Hit hit)
    {
        float         single;
        float         single1;
        IntersectHint intersectHint = Intersect3D.RayCircleInfiniteForward(ray, this.center, this.radius, out single, out single1);

        switch (intersectHint)
        {
        case IntersectHint.Touching:
        case IntersectHint.Thru:
        case IntersectHint.Entry:
        {
            hit.distance = Mathf.Min(single, single1);
            if (hit.distance < 0f)
            {
                float single2 = Mathf.Max(single, single1);
                float single3 = single2;
                hit.distance = single2;
                if (single3 < 0f)
                {
                    return(false);
                }
            }
            hit.point  = ray.GetPoint(hit.distance);
            hit.normal = Vector3.Normalize(hit.point - this.center);
            return(true);
        }
        }
        Debug.Log(intersectHint, this);
        return(false);
    }
コード例 #3
0
    internal bool Internal_RaycastRef(Ray ray, ref UIHotSpot.Hit hit)
    {
        float         num;
        float         num2;
        IntersectHint message = Intersect3D.RayCircleInfiniteForward(ray, this.center, this.radius, out num, out num2);

        switch (message)
        {
        case IntersectHint.Touching:
        case IntersectHint.Thru:
        case IntersectHint.Entry:
            hit.distance = Mathf.Min(num, num2);
            if ((hit.distance >= 0f) || ((hit.distance = Mathf.Max(num, num2)) >= 0f))
            {
                hit.point  = ray.GetPoint(hit.distance);
                hit.normal = Vector3.Normalize(hit.point - this.center);
                return(true);
            }
            return(false);
        }
        Debug.Log(message, this);
        return(false);
    }