Exemplo n.º 1
0
    //
    // Unity Methods
    //

    private IEnumerator Start()
    {
        dialogManager = FindObjectOfType <ModalDialogManager>();

        progressDialog = dialogManager.NewProgressDialog();
        progressDialog.SetMessage(Translator.Get("Loading") + " ...");
        progressDialog.SetProgress(0);

#if UNITY_WEBGL
        // Show welcome screen for online version
        dialogManager.ShowWebWelcomeMessage();
#endif

        yield return(WaitFor.Frames(WaitFor.InitialFrames - 1));            // -1 to initialize before all other components

        // Mandatory components
        var componentManager = ComponentManager.Instance;
        dataLayers       = componentManager.Get <DataLayers>();
        loadingComponent = componentManager.Get <LoadingComponent>();
        map = componentManager.Get <MapController>();

        dialogManager.UpdateUI();

        InitMapControllers();

        // Load config (groups & layers)
        StartCoroutine(Init());
    }
        private void InitializeUiComponents(ViewGroup container)
        {
            var loadingComponent = new LoadingComponent(container);
            var resultsComponent = new ResultsComponent(container);
            var errorComponent   = new ErrorComponent(container);

            _components = new List <UiComponent>
            {
                loadingComponent,
                resultsComponent,
                errorComponent
            };

            // uiEvents should initiate the stream of usecases from a presenter
            // like mvi. not the scope of this sample
        }
Exemplo n.º 3
0
    //
    // Unity Methods
    //

    private IEnumerator Start()
    {
        messageController = FindObjectOfType <MessageController>();
        if (messageController != null)
        {
            messageController.Show(true);
            messageController.SetMessage("Loading ...");
        }

        yield return(WaitFor.Frames(WaitFor.InitialFrames - 1));     // -1 to initialize before all other components

        // Mandatory components
        var componentManager = ComponentManager.Instance;

        dataLayers       = componentManager.Get <DataLayers>();
        loadingComponent = componentManager.Get <LoadingComponent>();
        map = componentManager.Get <MapController>();

        InitMapControllers();

        // Load config (groups & layers)
        StartCoroutine(Init());
    }
 private void EnableLoading(bool isEnable)
 {
     if (isEnable)
     {
         this.m_BackupUICameraStatus = true;
         this.DisableUICamera();
         // 获取加载图标
         this.m_LoadingComp = PoolMgr.Instance.GetComponent<LoadingComponent>(AssetPathConst.Component_Common + AssetNameConst.Loading);
        this.m_LoadingComp.MyTransform.SetParent(this.TopPanel);
         this.m_LoadingComp.MyTransform.localPosition = Vector3.zero;
     }
     else
     {
         this.SetUICamera(this.m_BackupUICameraStatus);
         this.m_LoadingComp.Dispose();
         this.m_LoadingComp = null;
     }
 }