Inheritance: MonoBehaviour, ITemplatable
Ejemplo n.º 1
0
    IEnumerator LoadSceneInternal()
    {
        displayProgress = 5;
        LoadingLayer.SetProgressbarTips("Scene Initialize ...");
        LoadingLayer.SetProgressbarValue(displayProgress);

        async     = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(loadSceneName); //Application.LoadLevelAsync(loadSceneName);
        IsLoading = true;
        async.allowSceneActivation = false;

        while (async.progress < 0.9f)
        {
            progress = (int)async.progress * 100;
            while (displayProgress < progress)
            {
                ++displayProgress;
                LoadingLayer.SetProgressbarValue(displayProgress);
                yield return(new WaitForEndOfFrame());
            }
            yield return(new WaitForEndOfFrame());
        }

        progress = 90;
        while (displayProgress < progress)
        {
            ++displayProgress;
            LoadingLayer.SetProgressbarValue(displayProgress);
            yield return(new WaitForEndOfFrame());
        }

        async.allowSceneActivation = true;
        InitializeScene();

        IsLoading = false;
    }
Ejemplo n.º 2
0
        private void load()
        {
            // Required for the pop in/out animation
            RelativePositionAxes = Axes.Both;

            Children = new Drawable[]
            {
                topBar = new ChatOverlayTopBar
                {
                    RelativeSizeAxes = Axes.X,
                    Height           = top_bar_height,
                },
                channelList = new ChannelList
                {
                    RelativeSizeAxes = Axes.Y,
                    Width            = side_bar_width,
                    Padding          = new MarginPadding {
                        Top = top_bar_height
                    },
                },
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Anchor           = Anchor.TopRight,
                    Origin           = Anchor.TopRight,
                    Padding          = new MarginPadding
                    {
                        Top    = top_bar_height,
                        Left   = side_bar_width,
                        Bottom = chat_bar_height,
                    },
                    Children = new Drawable[]
                    {
                        new Box
                        {
                            RelativeSizeAxes = Axes.Both,
                            Colour           = colourProvider.Background4,
                        },
                        currentChannelContainer = new Container <ChatOverlayDrawableChannel>
                        {
                            RelativeSizeAxes = Axes.Both,
                        },
                        loading        = new LoadingLayer(true),
                        channelListing = new ChannelListing
                        {
                            RelativeSizeAxes = Axes.Both,
                        },
                    },
                },
                textBar = new ChatTextBar
                {
                    RelativeSizeAxes = Axes.X,
                    Anchor           = Anchor.BottomRight,
                    Origin           = Anchor.BottomRight,
                    Padding          = new MarginPadding {
                        Left = side_bar_width
                    },
                },
            };
        }
Ejemplo n.º 3
0
    public static void Show()
    {
        if (layer)
        {
            return;
        }
        layer = Templates.GetDuplicate(key);

        layer.transform.SetParent(Global.MessageCanvas, false);
        layer.gameObject.SetActive(true);

        var rect = layer.GetComponent <RectTransform>();

        rect.sizeDelta        = new Vector2(Global.ReferenceResolution.x, Global.ReferenceResolution.y);
        rect.anchorMin        = new Vector2(0.5f, 0.5f);
        rect.anchorMax        = new Vector2(0.5f, 0.5f);
        rect.pivot            = new Vector2(0.5f, 0.5f);
        rect.anchoredPosition = Vector3.zero;

        if (progressbar == null)
        {
            progressbar = Util.Get <Progressbar>(layer.gameObject, "Progressbar");
        }
        if (textTips == null)
        {
            textTips = Util.Get <Text>(layer.gameObject, "TextTips");
        }

        Stick();

        isShow = true;
    }
 private void load()
 {
     AddInternal(loadingLayer = new LoadingLayer(true));
     initialBeatmap           = Beatmap.Value;
     initialRuleset           = Ruleset.Value;
     initialMods = Mods.Value.ToList();
 }
Ejemplo n.º 5
0
        private void load()
        {
            // todo: this should be implemented via a custom HUD implementation, and correctly masked to the main content area.
            LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(ScoreProcessor, userIds), HUDOverlay.Add);

            HUDOverlay.Add(loadingDisplay = new LoadingLayer(true)
            {
                Depth = float.MaxValue
            });

            if (Token == null)
            {
                return; // Todo: Somehow handle token retrieval failure.
            }
            client.MatchStarted += onMatchStarted;
            client.ResultsReady += onResultsReady;

            ScoreProcessor.HasCompleted.BindValueChanged(completed =>
            {
                // wait for server to tell us that results are ready (see SubmitScore implementation)
                loadingDisplay.Show();
            });

            isConnected = client.IsConnected.GetBoundCopy();
            isConnected.BindValueChanged(connected =>
            {
                if (!connected.NewValue)
                {
                    // messaging to the user about this disconnect will be provided by the MultiplayerMatchSubScreen.
                    failAndBail();
                }
            }, true);

            Debug.Assert(client.Room != null);
        }
 private void load()
 {
     Children = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = ColourProvider.Background5,
         },
         scrollFlow = new OverlayScrollContainer
         {
             RelativeSizeAxes = Axes.Both,
             ScrollbarVisible = false,
             Child            = new FillFlowContainer
             {
                 RelativeSizeAxes = Axes.X,
                 AutoSizeAxes     = Axes.Y,
                 Direction        = FillDirection.Vertical,
                 Children         = new Drawable[]
                 {
                     Header.With(h =>
                     {
                         h.ShowFrontPage = ShowFrontPage;
                     }),
                     content = new Container
                     {
                         RelativeSizeAxes = Axes.X,
                         AutoSizeAxes     = Axes.Y,
                     }
                 },
             },
         },
         loading = new LoadingLayer(content),
     };
 }
Ejemplo n.º 7
0
    IEnumerator OnInitializeComplete()
    {
        progress = 100;

        while (displayProgress < progress)
        {
            ++displayProgress;
            LoadingLayer.SetProgressbarValue(displayProgress);
            yield return(new WaitForEndOfFrame());
        }

        loadSceneName   = null;
        async           = null;
        progress        = 0;
        displayProgress = 0;
        sceneBundle.Unload(false);

        LoadingLayer.Hide();

        if (OnInitializeSceneComplete != null)
        {
            OnInitializeSceneComplete.Invoke();
            OnInitializeSceneComplete = null;
        }
    }
Ejemplo n.º 8
0
        private void load(IAPIProvider api)
        {
            apiState.BindTo(api.State);
            apiState.BindValueChanged(onlineStateChanged, true);

            Children = new Drawable[]
            {
                new Box
                {
                    RelativeSizeAxes = Axes.Both,
                    Colour           = ColourProvider.Background5
                },
                scrollFlow = new OverlayScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    ScrollbarVisible = false,
                    Child            = new FillFlowContainer
                    {
                        AutoSizeAxes     = Axes.Y,
                        RelativeSizeAxes = Axes.X,
                        Direction        = FillDirection.Vertical,
                        Children         = new Drawable[]
                        {
                            Header,
                            content = new Container
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y
                            }
                        }
                    }
                },
                loading = new LoadingLayer(content),
            };
        }
Ejemplo n.º 9
0
 private void load()
 {
     Children = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = ColourProvider.Background6
         },
         resultScrollContainer = new OverlayScrollContainer
         {
             RelativeSizeAxes = Axes.Both,
             ScrollbarVisible = false,
             Child            = new ReverseChildIDFillFlowContainer <Drawable>
             {
                 AutoSizeAxes     = Axes.Y,
                 RelativeSizeAxes = Axes.X,
                 Direction        = FillDirection.Vertical,
                 Children         = new Drawable[]
                 {
                     Header,
                     filterControl = new BeatmapListingFilterControl
                     {
                         TypingStarted  = onTypingStarted,
                         SearchStarted  = onSearchStarted,
                         SearchFinished = onSearchFinished,
                     },
                     new Container
                     {
                         AutoSizeAxes     = Axes.Y,
                         RelativeSizeAxes = Axes.X,
                         Children         = new Drawable[]
                         {
                             new Box
                             {
                                 RelativeSizeAxes = Axes.Both,
                                 Colour           = ColourProvider.Background4,
                             },
                             panelTarget = new Container
                             {
                                 AutoSizeAxes     = Axes.Y,
                                 RelativeSizeAxes = Axes.X,
                                 Padding          = new MarginPadding {
                                     Horizontal = 20
                                 },
                                 Children = new Drawable[]
                                 {
                                     foundContent    = new FillFlowContainer <BeatmapPanel>(),
                                     notFoundContent = new NotFoundDrawable(),
                                 }
                             }
                         },
                     },
                 }
             },
         },
         loadingLayer = new LoadingLayer(true)
     };
 }
Ejemplo n.º 10
0
 static void AssetsUpdateEnd()
 {
     if (OnAssetsUpdateComplete != null)
     {
         OnAssetsUpdateComplete.Invoke();
         OnAssetsUpdateComplete = null;
     }
     LoadingLayer.SetProgressbarTips("资源解包完成,准备初始化");
 }
 void ResourceUpdateEnd()
 {
     if (OnResourceUpdateComplete != null)
     {
         OnResourceUpdateComplete.Invoke();
         OnResourceUpdateComplete = null;
     }
     LoadingLayer.SetProgressbarTips("资源解包完成,准备初始化");
 }
Ejemplo n.º 12
0
    public static void Show()
    {
        if (layer)
        {
            return;
        }
        layer = Templates.GetDuplicate(key);

        layer.transform.SetParent(Global.MessageCanvas, false);
        layer.gameObject.SetActive(true);

        var rect = layer.GetComponent <RectTransform>();

        rect.sizeDelta        = new Vector2(100, 100);
        rect.anchorMin        = new Vector2(0.5f, 0.5f);
        rect.anchorMax        = new Vector2(0.5f, 0.5f);
        rect.pivot            = new Vector2(0.5f, 0.5f);
        rect.anchoredPosition = Vector3.zero;


        var img = layer.GetComponent <Image>();

        /*
         * if(rotator != null)
         * {
         *  rotator.Play();
         * }
         * else
         * {
         *  rotator = img.transform.DORotate(new Vector3(0, 0, 10), 0.2f, RotateMode.Fast).SetLoops(-1, LoopType.Incremental);
         * }
         */

        if (layer)
        {
            modalKey = ModleLayer.Open(layer, color: new Color(0.0f, 0.0f, 0.0f, 0.5f));
        }
        else
        {
            modalKey = null;
        }


        if (LoadingLayer.IsShow)
        {
            layer.transform.SetSiblingIndex(LoadingLayer.GetRenderOrder() - 1);
            if (modalKey != null)
            {
                ModleLayer.SetRenderOrder((int)modalKey, layer.transform.GetSiblingIndex());
            }
        }
        else
        {
            Stick();
        }
        isShow = true;
    }
Ejemplo n.º 13
0
 public static void Run(System.Action func)
 {
     LoadingLayer.Show();
     if (func != null)
     {
         OnAssetsUpdateComplete = func;
     }
     CheckUnpackAssets();
 }
 public void ResourceUpdateStart(System.Action func)
 {
     LoadingLayer.Show();
     if (func != null)
     {
         OnResourceUpdateComplete = func;
     }
     CheckExtractResource();
 }
Ejemplo n.º 15
0
    public static void Hide()
    {
        if (layer)
        {
            Templates.ReturnCache(layer);
            layer = null;
        }

        isShow = false;
    }
Ejemplo n.º 16
0
        private void load()
        {
            // todo: this should be implemented via a custom HUD implementation, and correctly masked to the main content area.
            LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(ScoreProcessor, userIds), HUDOverlay.Add);

            HUDOverlay.Add(loadingDisplay = new LoadingLayer(true)
            {
                Depth = float.MaxValue
            });
        }
Ejemplo n.º 17
0
    public static void Hide()
    {
        if (layer)
        {
            Templates.ReturnCache(layer);
            layer = null;
        }

        isShow = false;
    }
Ejemplo n.º 18
0
        private void load()
        {
            InternalChild = ContentContainer = new NonMaskedContent
            {
                X                = -WIDTH + ExpandedPosition,
                Width            = PANEL_WIDTH,
                RelativeSizeAxes = Axes.Y,
                Children         = new Drawable[]
                {
                    new Box
                    {
                        Anchor           = Anchor.TopRight,
                        Origin           = Anchor.TopRight,
                        Scale            = new Vector2(2, 1), // over-extend to the left for transitions
                        RelativeSizeAxes = Axes.Both,
                        Colour           = OsuColour.Gray(0.05f),
                        Alpha            = 1,
                    },
                    loading = new LoadingLayer
                    {
                        State = { Value = Visibility.Visible }
                    }
                }
            };

            Add(SectionsContainer = new SettingsSectionsContainer
            {
                Masking          = true,
                RelativeSizeAxes = Axes.Both,
                ExpandableHeader = CreateHeader(),
                SelectedSection  = { BindTarget = CurrentSection },
                FixedHeader      = searchTextBox = new SeekLimitedSearchTextBox
                {
                    RelativeSizeAxes = Axes.X,
                    Origin           = Anchor.TopCentre,
                    Anchor           = Anchor.TopCentre,
                    Width            = 0.95f,
                    Margin           = new MarginPadding
                    {
                        Top    = 20,
                        Bottom = 20
                    },
                },
                Footer = CreateFooter().With(f => f.Alpha = 0)
            });

            if (showSidebar)
            {
                AddInternal(Sidebar = new Sidebar {
                    Width = sidebar_width
                });
            }

            CreateSections()?.ForEach(AddSection);
        }
Ejemplo n.º 19
0
    private void ResourceUpdateEnd()
    {
        LoadingLayer.Hide();

        Gate.ResMgr.Initialize(AppConst.AppName.ToLower(), () =>
        {
            if (OnResourceUpdateEndAction != null)
            {
                OnResourceUpdateEndAction();
            }
        });
    }
Ejemplo n.º 20
0
 private void GetLoadingLayer()
 {
     if (m_LoadingLayer == null)
     {
         GameObject go =
             GameObject.FindGameObjectWithTag(Constants.SceneObject_LoadingLayer);
         if (go != null)
         {
             m_LoadingLayer = go.GetComponent <LoadingLayer>();
         }
     }
 }
Ejemplo n.º 21
0
    void LoadAssetbundleManifest()
    {
        LoadingLayer.SetProgressbarTips("游戏初始化中");
        LoadingLayer.SetProgressbarValue(5);
        string bundlName = AppPlatform.GetAssetBundleDirName();

        Global.AssetLoadManager.DownloadingURL = AppPlatform.GetRuntimeAssetBundleUrl();
        Global.AssetLoadManager.LoadManifest(bundlName, () =>
        {
            onStartupFunc();
        });
    }
Ejemplo n.º 22
0
        public RankingsOverlay()
            : base(OverlayColourScheme.Green, new RankingsOverlayHeader
        {
            Anchor = Anchor.TopCentre,
            Origin = Anchor.TopCentre,
            Depth  = -float.MaxValue
        })
        {
            loading = new LoadingLayer(true);

            Children = new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both
                },
                scrollFlow = new OverlayScrollContainer
                {
                    RelativeSizeAxes = Axes.Both,
                    ScrollbarVisible = false,
                    Child            = new FillFlowContainer
                    {
                        AutoSizeAxes     = Axes.Y,
                        RelativeSizeAxes = Axes.X,
                        Direction        = FillDirection.Vertical,
                        Children         = new Drawable[]
                        {
                            Header,
                            new Container
                            {
                                RelativeSizeAxes = Axes.X,
                                AutoSizeAxes     = Axes.Y,
                                Children         = new Drawable[]
                                {
                                    contentContainer = new Container
                                    {
                                        Anchor           = Anchor.TopCentre,
                                        Origin           = Anchor.TopCentre,
                                        AutoSizeAxes     = Axes.Y,
                                        RelativeSizeAxes = Axes.X,
                                        Margin           = new MarginPadding {
                                            Bottom = 10
                                        }
                                    },
                                }
                            }
                        }
                    }
                },
                loading
            };
        }
Ejemplo n.º 23
0
    public void LoadScene(string sceneName, Action cb = null)
    {
        LoadingLayer loadingLayer = null;

        //if (sceneName == "MainMenu")
        {
            loadingLayer = UIHelper.Instance.New <LoadingLayer>(transform);
            loadingLayer.Show();
        }


        StartCoroutine(LoadAsyncScene(sceneName, loadingLayer, cb));
    }
Ejemplo n.º 24
0
        public VisRenderingContext3D(ISettings settings, Control targetRenderArea,
                                     CommonDeviceInterface cdi, GraphicsProfile gProfile)
            : base(targetRenderArea, gProfile, cdi, (HashTableSettings)settings)
        {
            /*List<ISharableResource> shared = new List<ISharableResource>();
             * ILayer layer = (ILayer)devIf.GetSharedResource("file://media/ui/common/WelcomeLayer.xml", ref shared);
             * layers.InsertLayer(layer, uint.MinValue);*/

            //deMap = new DigitalElevationMap(new Size(), null);
            //deMap.Init(devIf.Device);

            loadingLayer = new LoadingLayer(devIf, new Point(), new Size(300, 300), "LoadingLayer", null, null);
            layers.InsertLayer(loadingLayer, uint.MinValue);
        }
Ejemplo n.º 25
0
        private void load()
        {
            if (!LoadedBeatmapSuccessfully)
            {
                return;
            }

            HUDOverlay.Add(leaderboardFlow = new FillFlowContainer
            {
                AutoSizeAxes = Axes.Both,
                Direction    = FillDirection.Vertical,
                Spacing      = new Vector2(5)
            });

            HUDOverlay.HoldingForHUD.BindValueChanged(_ => updateLeaderboardExpandedState());
            LocalUserPlaying.BindValueChanged(_ => updateLeaderboardExpandedState(), true);

            // todo: this should be implemented via a custom HUD implementation, and correctly masked to the main content area.
            LoadComponentAsync(leaderboard = new MultiplayerGameplayLeaderboard(users), l =>
            {
                if (!LoadedBeatmapSuccessfully)
                {
                    return;
                }

                leaderboard.Expanded.BindTo(leaderboardExpanded);

                leaderboardFlow.Insert(0, l);

                if (leaderboard.TeamScores.Count >= 2)
                {
                    LoadComponentAsync(new GameplayMatchScoreDisplay
                    {
                        Team1Score = { BindTarget = leaderboard.TeamScores.First().Value },
                        Team2Score = { BindTarget = leaderboard.TeamScores.Last().Value },
                        Expanded   = { BindTarget = HUDOverlay.ShowHud },
                    }, scoreDisplay => leaderboardFlow.Insert(1, scoreDisplay));
                }
            });

            LoadComponentAsync(new GameplayChatDisplay(Room)
            {
                Expanded = { BindTarget = leaderboardExpanded },
            }, chat => leaderboardFlow.Insert(2, chat));

            HUDOverlay.Add(loadingDisplay = new LoadingLayer(true)
            {
                Depth = float.MaxValue
            });
        }
Ejemplo n.º 26
0
        public LoungeSubScreen()
        {
            SearchContainer searchContainer;

            InternalChildren = new Drawable[]
            {
                Filter = new FilterControl {
                    Depth = -1
                },
                content = new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Children         = new Drawable[]
                    {
                        new Container
                        {
                            RelativeSizeAxes = Axes.Both,
                            Width            = 0.55f,
                            Children         = new Drawable[]
                            {
                                new OsuScrollContainer
                                {
                                    RelativeSizeAxes         = Axes.Both,
                                    ScrollbarOverlapsContent = false,
                                    Padding = new MarginPadding(10),
                                    Child   = searchContainer = new SearchContainer
                                    {
                                        RelativeSizeAxes = Axes.X,
                                        AutoSizeAxes     = Axes.Y,
                                        Child            = new RoomsContainer {
                                            JoinRequested = joinRequested
                                        }
                                    },
                                },
                                loadingLayer = new LoadingLayer(searchContainer),
                            }
                        },
                        new RoomInspector
                        {
                            Anchor           = Anchor.TopRight,
                            Origin           = Anchor.TopRight,
                            RelativeSizeAxes = Axes.Both,
                            Width            = 0.45f,
                        },
                    },
                },
            };
        }
Ejemplo n.º 27
0
        private void ShowLoadingLayerAutoClose()
        {
            LoadingLayer ll = new LoadingLayer(this, .8D, true);

            ll.ShowAutoClose(o =>
            {
                LoadingLayer layer = (LoadingLayer)o;

                for (int i = 0; i < 10; i++)
                {
                    Thread.Sleep(500);
                    int progress = (i + 1) * 10;
                    layer.UpdateProgress(progress, $"当前进度 {progress}%");
                }
            }, ll);
        }
Ejemplo n.º 28
0
 public TestSceneUserRequest()
 {
     Add(new Container
     {
         Anchor       = Anchor.Centre,
         Origin       = Anchor.Centre,
         AutoSizeAxes = Axes.Both,
         Children     = new Drawable[]
         {
             new UserTestContainer
             {
                 User = { BindTarget = user }
             },
             loading = new LoadingLayer()
         }
     });
 }
Ejemplo n.º 29
0
 private void load()
 {
     Children = new Drawable[]
     {
         new Box
         {
             RelativeSizeAxes = Axes.Both,
             Colour           = ColourProvider.Background5
         },
         scrollFlow = new OverlayScrollContainer
         {
             RelativeSizeAxes = Axes.Both,
             ScrollbarVisible = false,
             Child            = new FillFlowContainer
             {
                 AutoSizeAxes     = Axes.Y,
                 RelativeSizeAxes = Axes.X,
                 Direction        = FillDirection.Vertical,
                 Children         = new Drawable[]
                 {
                     Header,
                     content = new Container
                     {
                         RelativeSizeAxes = Axes.X,
                         AutoSizeAxes     = Axes.Y
                     }
                 }
             }
         },
         loading = new LoadingLayer(content),
         placeholderContainer = new Container
         {
             Anchor           = Anchor.TopCentre,
             Origin           = Anchor.TopCentre,
             AutoSizeAxes     = Axes.Y,
             RelativeSizeAxes = Axes.X,
             Margin           = new MarginPadding {
                 Bottom = 10, Top = 200
             }
         }
     };
     api?.Register(this);
     errorPlaceholder           = new LoginPlaceholder(@"Please sign in to view the dashboard!");
     placeholderContainer.Child = errorPlaceholder;
 }
Ejemplo n.º 30
0
    public void EnterScene(string rSceneName, UnityEngine.Events.UnityAction rOnInitSceneBegin = null, UnityEngine.Events.UnityAction rOnInitSceneEnd = null)
    {
        if (String.IsNullOrEmpty(rSceneName))
        {
            throw new NullReferenceException("loadSceneName is null");
        }
        else
        {
            loadSceneName = rSceneName;
        }

        OnInitializeScene         = rOnInitSceneBegin;
        OnInitializeSceneComplete = rOnInitSceneEnd;

        LoadingLayer.Show();

        LoadScene();
    }
Ejemplo n.º 31
0
 public void SetUp() => Schedule(() =>
 {
     Children = new[]
     {
         content = new Container
         {
             Size     = new Vector2(300),
             Anchor   = Anchor.Centre,
             Origin   = Anchor.Centre,
             Children = new[]
             {
                 new Box
                 {
                     Colour           = Color4.SlateGray,
                     RelativeSizeAxes = Axes.Both,
                 },
                 dimContent = new FillFlowContainer
                 {
                     Anchor           = Anchor.Centre,
                     Origin           = Anchor.Centre,
                     Direction        = FillDirection.Vertical,
                     Spacing          = new Vector2(10),
                     RelativeSizeAxes = Axes.Both,
                     Size             = new Vector2(0.9f),
                     Children         = new Drawable[]
                     {
                         new OsuSpriteText {
                             Text = "Sample content"
                         },
                         new TriangleButton {
                             Text = "can't puush me", Width = 200,
                         },
                         new TriangleButton {
                             Text = "puush me", Width = 200, Action = () => { }
                         },
                     }
                 },
                 overlay = new LoadingLayer(dimContent),
             }
         },
     };
 });
Ejemplo n.º 32
0
    public static void Show()
    {
        if (layer) return;
        layer = Templates.GetDuplicate(key);

        layer.transform.SetParent(Global.MessageCanvas, false);
        layer.gameObject.SetActive(true);

        var rect = layer.GetComponent<RectTransform>();
        rect.sizeDelta = new Vector2(Global.ReferenceResolution.x, Global.ReferenceResolution.y);
        rect.anchorMin = new Vector2(0.5f, 0.5f);
        rect.anchorMax = new Vector2(0.5f, 0.5f);
        rect.pivot = new Vector2(0.5f, 0.5f);
        rect.anchoredPosition = Vector3.zero;

        if (progressbar == null)
        {
            progressbar = Util.Get<Progressbar>(layer.gameObject, "Progressbar");
        }
        if (textTips == null)
        {
            textTips = Util.Get<Text>(layer.gameObject, "TextTips");
        }

        Stick();

        isShow = true;
    }