void Start() { pauseLoading = false; cameraExtents = CameraModeChanger.Instance.CurrentCameraExtends; CameraModeChanger.Instance.OnFirstPersonModeEvent += OnCameraChanged; CameraModeChanger.Instance.OnGodViewModeEvent += OnCameraChanged; }
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); }
/// <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); }
public void OnCameraChanged() { cameraExtents = CameraModeChanger.Instance.CurrentCameraExtends; }