Exemplo n.º 1
0
        void IOverlayUiBank.RegisterCanvas <T>(T overlayUiCanvas)
        {
            if (canvasBank == null)
            {
                Debug.LogError($"has not inited {this.GetType().Name}");
                return;
            }

            OverlayUiStatus <T> status = StatusCache <T> .Cache;

            if (status == null)
            {
                Debug.LogError($"has not inited status by using Show function: {typeof(T).Name}");
                return;
            }

            if (!status.TrySetUiCanvas(overlayUiCanvas))
            {
                return;
            }

            CanvasInStratum canvasInStratum = new CanvasInStratum(
                ConstStratum.Overlay,
                overlayUiCanvas.OrderInStratum,
                overlayUiCanvas.CanvasOrderUpdater);

            canvasBank.AddCanvas(canvasInStratum);
        }
Exemplo n.º 2
0
        public OverlayUiOperator Show <T>() where T : IOverlayUiCanvas
        {
            if (StatusCache <T> .Cache == null)
            {
                StatusCache <T> .SetCache(new OverlayUiStatus <T>(idGenerator));

                sceneLoader.Load <T>();
            }

            OverlayUiStatus <T> status = StatusCache <T> .Cache;

            return(status.GetChecker());
        }