Ejemplo n.º 1
0
        protected void Awake()
        {
            Debug.Log("AppState awakens");
            if (instance == null)
            {
                Debug.Log("AppState instance assigned");
                instance = this;
            }
            else if (instance != this)
            {
                // there cannot be another instance
                Debug.Log("AppState found another instance");
                Destroy(gameObject);
            }
            DontDestroyOnLoad(gameObject);
            _editSession = new EditSession();
            _layers      = new List <VirgisLayer>();
            Zoom         = new ZoomEvent();
            Project      = new ProjectChange();
            Info         = new InfoEvent();
            ButtonStatus = new ButtonStatus();
            Orientation  = new OrientEvent();
            LayerUpdate  = new LayerChange();

            initsub = Project.Event.Subscribe(proj => Init());
            try {
                GdalConfiguration.ConfigureOgr();
            } catch (Exception e) {
                Debug.LogError(e.ToString());
            };
            try {
                GdalConfiguration.ConfigureGdal();
            } catch (Exception e) {
                Debug.LogError(e.ToString());
            };
            try {
                PdalConfiguration.ConfigurePdal();
            } catch (Exception e) {
                Debug.LogError(e.ToString());
            };
            try {
                Debug.Log($" MDAL Version : {MdalConfiguration.ConfigureMdal()}");
            } catch (Exception e) {
                Debug.LogError(e.ToString());
            }
            Gdal.SetConfigOption("CURL_CA_BUNDLE", Path.Combine(Application.streamingAssetsPath, "gdal", "cacert.pem"));
        }
Ejemplo n.º 2
0
        void Awake()
        {
            print("AppState awakens");
            if (instance == null)
            {
                print("AppState instance assigned");
                instance = this;
            }
            else if (instance != this)
            {
                // there cannot be another instance
                print("AppState found another instance");
                Destroy(gameObject);
            }

            DontDestroyOnLoad(gameObject);
            _editSession = new EditSession();
            _layers      = new List <Component>();
            _zoomChange  = new ZoomEvent();
        }