コード例 #1
0
        protected bool CheckCameraBounds(Vector3 finalPos)
        {
            var bl = _screen.GetCorner(CameraPoint.BottonLeft, _cameraDistance - _bounds.size.z / 2);
            var tr = _screen.GetCorner(CameraPoint.TopRight, _cameraDistance - _bounds.size.z / 2);

            return(finalPos.x + _bounds.size.x / 2 + BorderOffset > tr.x || finalPos.x - _bounds.size.x / 2 - BorderOffset < bl.x);
        }
コード例 #2
0
        protected bool CheckCameraBounds(Vector3 finalPos)
        {
            var bl = _screen.GetCorner(CameraPoint.BottonLeft, _cameraDistance);
            var tr = _screen.GetCorner(CameraPoint.TopRight, _cameraDistance);

            return(
                finalPos.x < tr.x && finalPos.x > bl.x &&
                finalPos.y < tr.y && finalPos.y > bl.y
                );
        }