コード例 #1
0
    public void Initialize()
    {
        GlobalVar.Instance.zoom        = _settings.zoomMap.AbsoluteZoom;
        GlobalVar.Instance.currentZoom = _settings.zoomMap.AbsoluteZoom;

        _globalDataSettings.afterZoom = _globalDataSettings.afterZoom = _settings.zoomMap.AbsoluteZoom;
        #region client

        _settings.clearBtn.onClick.AddListener(() => { Mapbox.Unity.MapboxAccess.Instance.ClearCache(); });
        //_settings.DrawBtn.onClick.AddListener(() =>
        //{
        //    gRpcClient.OnClick();
        //});

        #endregion

        #region mapbox

        _settings.outdoorBtn.onClick.AddListener(() =>
        {
            _settings.zoomMap.GetComponentInChildren <ChangeStyle>().ChangeStyleInruntime("outdoor");
        });
        _settings.stateliteBtn.onClick.AddListener(() =>
        {
            _settings.zoomMap.GetComponentInChildren <ChangeStyle>().ChangeStyleInruntime("statelite");
        });

        #endregion

        #region MainUI

        _settings.to3DMapBtn.onClick.AddListener(() =>
        {
            _settings.webUI.gameObject.SetActive(false);
            _settings.mapboxPanel.gameObject.SetActive(true);
            _settings.zoomMap.gameObject.SetActive(true);
            _settings.zoomMap.GetComponentInChildren <QuadTreeTileProvider>().enabled = true;
        });

        _settings.to2DScheduleBtn.onClick.AddListener(() =>
        {
            _settings.webUI.gameObject.SetActive(true);
            _settings.mapboxPanel.gameObject.SetActive(false);
            //_settings.Mapbox.gameObject.SetActive(false);
        });

        #endregion

        _zoomChangeDSignal += ChangeDSignal;
        _toGlobalSignal    += ToGloabl;


        bool is2dor3d = false;
        _settings.twoorThree.onClick.AddListener((() =>
        {
            if (is2dor3d)
            {
                _settings.twoorThree.GetComponent <Image>().sprite = _settings.D2;
                _globalDataSettings.is2or3 = false;
                _settings.viewCamera.transform.DOLocalRotate(new Vector3(0, 0, 0), 0.5f);
                _settings.viewCamera.transform.DOLocalMove(new Vector3(0, 0, 0), 0.5f);
            }
            else
            {
                _settings.twoorThree.GetComponent <Image>().sprite = _settings.D3;
                _zoomChangeDSignal.Fire();
            }
            is2dor3d = !is2dor3d;
            _globalDataSettings.is2or3 = is2dor3d;
        }));
    }
コード例 #2
0
 public void Dispose()
 {
     _zoomChangeDSignal -= ChangeDSignal;
     _toGlobalSignal    -= ToGloabl;
 }
コード例 #3
0
 public ZoomMap(Settings settings, ZoomChangeDSignal zoomChangeDSignal, ToGlobalSignal toGlobalSignal)
 {
     _settings          = settings;
     _zoomChangeDSignal = zoomChangeDSignal;
     _toGlobalSignal    = toGlobalSignal;
 }