Пример #1
0
        internal NativePluginRunner(
            string apiKey,
            TextureLoadHandler textureLoadHandler,
            MaterialRepository materialRepository,
            MapGameObjectScene mapGameObjectScene,
            ConfigParams config,
            IndoorMapScene indoorMapScene,
            IndoorMapsApiInternal indoorMapsApiInternal,
            IndoorMapMaterialService indoorMapMaterialService,
            LabelServiceInternal labelServiceInternal,
            PositionerApiInternal positionerApiInternal,
            CameraApiInternal cameraApiInternal,
            BuildingsApiInternal buildingsApiInternal,
            PrecacheApiInternal precacheApiInternal)
        {
            m_threadService      = new ThreadService();
            m_textureLoadHandler = textureLoadHandler;
            m_materialRepository = materialRepository;
            m_mapGameObjectScene = mapGameObjectScene;
            m_streamingUpdater   = new StreamingUpdater();

            var nativeConfig = config.GetNativeConfig();
            var pathString   = GetStreamingAssetsDir();
            var pathBytes    = GetNullTerminatedUTF8Bytes(pathString);

            var indoorMapsApiHandle            = indoorMapsApiInternal.GetHandle();
            var indoorMapMaterialServiceHandle = indoorMapMaterialService.GetHandle();

            var apiCallbacks = new ApiCallbacks(
                indoorMapsApiHandle,
                indoorMapMaterialServiceHandle,
                indoorMapScene.GetHandle(),
                cameraApiInternal.GetHandle(),
                buildingsApiInternal.GetHandle(),
                m_threadService.GetHandle(),
                textureLoadHandler.GetHandle(),
                mapGameObjectScene.GetHandle(),
                labelServiceInternal.GetHandle(),
                positionerApiInternal.GetHandle(),
                precacheApiInternal.GetHandle());

            Initialize(Screen.width, Screen.height, Screen.dpi,
                       apiKey,
                       pathBytes,
                       ref nativeConfig,
                       ref apiCallbacks,
                       config.CoverageTreeManifestUrl,
                       config.ThemeManifestUrl
                       );

            API = GetAppInterface();
            Debug.Assert(API != IntPtr.Zero);

            m_isRunning = true;
        }