예제 #1
0
        ///<summary> This method will get the edges of the camera and return the edge camera pos (only for ortho) </summary>
        public static Vector3 GlobalOrthoByPort(this Camera camera, AnchorType anchor)
        {
            switch (anchor)
            {
            case AnchorType.TopLeft:    return(camera.ViewportToWorldPoint(topLeft.ToUnity()));

            case AnchorType.BottomLeft: return(camera.ViewportToWorldPoint(bottomLeft.ToUnity()));

            case AnchorType.TopRight:    return(camera.ViewportToWorldPoint(rightTop.ToUnity()));

            case AnchorType.BottomRight: return(camera.ViewportToWorldPoint(rightBottom.ToUnity()));


            case AnchorType.TopCenter:    return(camera.ViewportToWorldPoint(centerTop.ToUnity()));

            case AnchorType.BottomCenter: return(camera.ViewportToWorldPoint(centerDown.ToUnity()));

            case AnchorType.LeftCenter:  return(camera.ViewportToWorldPoint(centerLeft.ToUnity()));

            case AnchorType.RightCenter: return(camera.ViewportToWorldPoint(centerRight.ToUnity()));

            case AnchorType.Center: return(camera.ViewportToWorldPoint(center.ToUnity()));
            }

            throw ExceptionUtils.NotAccessible;
        }