Ejemplo n.º 1
0
 public void WaitUi(string id,
                    Action <ILegoUI> callback,
                    LegoViewType uiLayeredCanvas = LegoViewType.DynamicBackground,
                    int buildSpped = -1,
                    bool isBindNexRxModelOnBuild = true)
 {
     uILoader.WaitUi(id, callback, uiLayeredCanvas, isBindRxModelOnBuild: isBindNexRxModelOnBuild);
 }
        private void LoadMeta()
        {
            var metaHelper = Injector.Instance.Get <LegoMetaHelper>();
            var uiMeta     = metaHelper.GetMeta(name);

            if (uiMeta == null)
            {
                return;
            }

            ViewType     = uiMeta.ViewType;
            HideTargets  = uiMeta.HideTargets;
            IsBlankClose = uiMeta.IsBlankClose;
        }
Ejemplo n.º 3
0
        public void WaitUi(string id,
                           Action <ILegoUI> onloaded,
                           LegoViewType uiLayeredCanvas = LegoViewType.DynamicBackground,
                           int speed                 = -1,
                           bool isInBack             = false,
                           bool isBindRxModelOnBuild = true)
        {
            if (id.StartsWith(LEGO_VIEW))
            {
                WaitView(id, onloaded, speed, isInBack);
            }
            else
            {
                WaitComponent(id, onloaded, speed, uiLayeredCanvas, isInBack, isBindRxModelOnBuild);
            }

            TryStartNextTask();
        }
Ejemplo n.º 4
0
        private void WaitComponent(string id,
                                   Action <ILegoUI> uiLoadCallback,
                                   int buildSpeed,
                                   LegoViewType uiLayeredCanvas = LegoViewType.DynamicBackground,
                                   bool isInback             = false,
                                   bool isBindRxModelOnBuild = true)
        {
            if (componentCache.ContainsKey(id) && componentCache[id].Count > 0)
            {
                var components = componentCache[id];
                var component  = components.Dequeue();
                uiLoadCallback?.Invoke(component);
                return;
            }

            var task = LegoBuilder.CreateTask(id, OnBuilded, null, buildSpeed)
                       .SetUILoadCallback(uiLoadCallback)
                       .SetBackLoad(isInback)
                       .SetBindRxModel(isBindRxModelOnBuild)
                       .SetParentCanvas(uiLayeredCanvas);

            waitTasks.Enqueue(task);
        }
Ejemplo n.º 5
0
 public LegoBuildTask SetParentCanvas(LegoViewType parentCanvasType)
 {
     ParentCanvas = parentCanvasType;
     return(this);
 }
Ejemplo n.º 6
0
        private void AddViewToDepthViews(ILegoView view, LegoViewType viewType)
        {
            var layer = LegoUIMounter.uiLayers[viewType];

            layer.PushView(view);
        }