예제 #1
0
 void Start()
 {
     pauseLoading  = false;
     cameraExtents = CameraModeChanger.Instance.CurrentCameraExtends;
     CameraModeChanger.Instance.OnFirstPersonModeEvent += OnCameraChanged;
     CameraModeChanger.Instance.OnGodViewModeEvent     += OnCameraChanged;
 }
예제 #2
0
        private Vector3Int GetCameraPosition(ICameraExtents cameraExtents)
        {
            var        cameraPositionRD = CoordConvert.UnitytoRD(cameraExtents.GetPosition());
            Vector3Int cameraPosition   = new Vector3Int();

            cameraPosition.x = (int)cameraPositionRD.x;
            cameraPosition.y = (int)cameraPositionRD.y;
            cameraPosition.z = (int)cameraPositionRD.z;
            return(cameraPosition);
        }
예제 #3
0
        /// <summary>
        /// uses CameraExtent
        /// updates the variable viewrange
        /// updates the variable cameraPositionRD
        /// updates the variable cameraPosition
        /// </summary>
        private Vector4 GetViewRange(ICameraExtents cameraExtents)
        {
            var     bottomLeft = CoordConvert.WGS84toRD(cameraExtents.GetExtent().MinX, cameraExtents.GetExtent().MinY);
            var     topRight   = CoordConvert.WGS84toRD(cameraExtents.GetExtent().MaxX, cameraExtents.GetExtent().MaxY);
            Vector4 viewRange  = new Vector4();

            viewRange.x = (float)bottomLeft.x;
            viewRange.y = (float)bottomLeft.y;
            viewRange.z = (float)(topRight.x - bottomLeft.x);
            viewRange.w = (float)(topRight.y - bottomLeft.y);

            return(viewRange);
        }
예제 #4
0
 public void OnCameraChanged()
 {
     cameraExtents = CameraModeChanger.Instance.CurrentCameraExtends;
 }