コード例 #1
0
    public static ModalConnectToGamePanel Instance()
    {
        if (!modalPanel)
        {
            modalPanel = FindObjectOfType(typeof(ModalConnectToGamePanel)) as ModalConnectToGamePanel;
            if (!modalPanel)
            {
                Debug.LogError("There needs to be one active ModalPanel script on a GameObject in your scene.");
            }
        }

        return(modalPanel);
    }
コード例 #2
0
 /// <summary>
 /// Close the Panel when the user tries to connect the game, and deactivate each object
 /// </summary>
 private void ConnectToGame()
 {
     ModalConnectToGamePanel.Instance().ClosePanel();
     clueLessGraphicalGameplayObjects.ForEach(go => go.SetActive(true));
 }
コード例 #3
0
 void Start()
 {
     // Show the Connect to Game Panel when the game first starts
     // When the panel is closed ConnectToGame() is called
     ModalConnectToGamePanel.Instance().ShowPanel(() => ConnectToGame());
 }