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); }
/// <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)); }
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()); }