Exemple #1
0
    private async Task ShowLevelCleared()
    {
        PopupPanel panel = ((PopupPanel)FindNode("LevelClearedPanel"));
        Label      label = (Label)panel.FindNode("Message");

        if (Global.CurrentLevel < Const.MAX_LEVELS)
        {
            label.Text     = string.Format("Level {0} cleared.\n\nLet's go to\nthe next level!", Global.CurrentLevel);
            timer.WaitTime = 2.0f;
        }
        else
        {
            label.Text     = "Congratulations!\n\nAll levels cleared!!!";
            timer.WaitTime = 5.0f;
        }
        panel.ShowModal();

        timer.OneShot = true;
        var awaiter = ToSignal(timer, "timeout");

        timer.Start();
        await awaiter;

        panel.Hide();
    }