public void StartGame() { if (PlayerPrefs.GetInt(LudoTags.GAME_TYPE) != LudoTags.OFFLINE) { if (this.myColor > 0) { appwarp.joinGame(this.myColor); LoadingText.SetActive(true); if (PlayerPrefs.GetInt(LudoTags.ROOM_TYPE) == LudoTags.PUBLIC) { //appwarp.ServerMessage = "Waiting for Opponent"; //loading.GetComponent<LoadingPanel>().startTimer(10, "No Opponent found. Try after some time."); } else { colorSelectionPanel.SetActive(false); //loading.SetActive(true); // appwarp.ServerMessage = "Creating Table"; //loading.GetComponent<LoadingPanel>().startTimer(15, "Unable to create private table. Please try again later."); } } } else { if (this.myColor == 0) { colorSelectionPanel.transform.Find("Box").GetComponent <ColorSelection>().defaultColor(); } LudoDelegate.startGame(); colorSelectionPanel.SetActive(false); } }
void Start() { Screen.sleepTimeout = SleepTimeout.NeverSleep; try { // loading = transform.Find("LoadingGamePanel").gameObject; LoadingText.SetActive(false); //chatButton = GameObject.FindGameObjectWithTag("ChatButton"); // smileyButton = GameObject.FindGameObjectWithTag("SmileyButton"); } catch (System.Exception ex) { Debug.Log(ex.Message); } try { // quitGamePanel = transform.Find("QuitGamePanel").gameObject; // privateInfo = transform.Find("PrivateTablePage").gameObject; quitGamePanel.SetActive(false); } catch (System.Exception ex) { Debug.Log(ex.Message); } try { // messagePanel = transform.Find("MessagePanel").gameObject; // smileyPanel = transform.Find("SmileyPanel").gameObject; messagePanel.SetActive(false); smileyPanel.SetActive(false); } catch (System.Exception ex) { Debug.Log(ex.Message); } try { // winnerPanel = transform.Find("WinnerPanel").gameObject; // lossPanel = transform.Find("LossPanel").gameObject; // colorSelectionPanel = transform.Find("SelectColorPanel").gameObject; } catch (System.Exception ex) { Debug.Log(ex.Message); } if (PlayerPrefs.GetInt(LudoTags.GAME_TYPE) != LudoTags.OFFLINE) { LudoDelegate.startGame(); } if (PlayerPrefs.GetInt(LudoTags.GAME_TYPE) != LudoTags.OFFLINE) { chatButton.SetActive(true); smileyButton.SetActive(true); } else { chatButton.SetActive(false); smileyButton.SetActive(false); } }