Exemplo n.º 1
0
 public void OpenMultiplayerMenu()
 {
     multiplayerWarning.Open(() =>
     {
         multiplayerWarning.Close();
         multiplayerMenu.Open();
         openPanels.Add(multiplayerMenu);
     });
 }
Exemplo n.º 2
0
    // Convenience
    public void AskHowToPlay(System.Action <GameBuilderApplication.PlayOptions> onResponse)
    {
#if USE_PUN
        Show(new DynamicPopup.Popup
        {
            fullWidthButtons = true,
            getMessage       = () => "<size=80%>Play as single player or multiplayer?",
            isCancellable    = true,
            buttons          = new List <PopupButton.Params>()
            {
                new PopupButton.Params
                {
                    getLabel = () => "Single Player",
                    onClick  = () => onResponse(new GameBuilderApplication.PlayOptions {
                        isMultiplayer = false
                    })
                },
                new PopupButton.Params
                {
                    getLabel = () => "Private Multiplayer",
                    onClick  = () => onResponse(new GameBuilderApplication.PlayOptions {
                        isMultiplayer = true, startAsPublic = false
                    })
                },
                new PopupButton.Params
                {
                    getLabel = () => "Public Multiplayer",
                    onClick  = () => {
                        MultiplayerWarning warning = null;
                        Util.FindIfNotSet(this, ref warning);
                        warning.Open(() => {
                            onResponse(new GameBuilderApplication.PlayOptions {
                                isMultiplayer = true, startAsPublic = true
                            });
                        });
                    }
                },
                new PopupButton.Params
                {
                    getLabel = () => "Cancel",
                    onClick  = () => {}
                },
            }
        });
#else
        StartCoroutine(CallNextFrame(() => onResponse(new GameBuilderApplication.PlayOptions {
            isMultiplayer = false
        })));
#endif
    }