private IEnumerator WaitForDataAndBackToGame(string RoomName, string gameMode) { MyNetworkManager netManager = GameObject.Find("NetworkManager").GetComponent <MyNetworkManager> (); DeckTableController deckTable = GameObject.Find("DeckSelect-Canvas").GetComponent <DeckTableController> (); if (netManager != null) { while (DataSaved) { yield return(new WaitForSeconds(0.5f)); } netManager.GameMode = (MyNetworkManager.gameModeEnum)Enum.Parse(typeof(MyNetworkManager.gameModeEnum), gameMode); GameObject deck = deckTable.SpawnDeck(FromPrevGame.DeckName, FromPrevGame.HeroName, FromPrevGame.CardsNames); //deck.GetComponent<Deck> ().SpawnReverses (Deck.deckSize); deck.transform.localScale = new Vector3(0, 0, 0); netManager.PrevRoomName = RoomName; netManager.MainMenuComponent.SetupPlayButtonReconnect(); netManager.SetDeckToPlay(deck); if (netManager.AutoRejoin) { netManager.RejoinGame(); } } yield return(null); }
private void PressDeck() { if (PanelActive) { if (DeckAvailable) { if (Controller == null) { Controller = GameObject.Find("DeckSelect-Canvas").GetComponent <DeckTableController> (); } SelectDeck(); } if (DeckAvailable) { Controller.ChooseDeck(index); } } }
void Start() { Controller = GameObject.Find("DeckSelect-Canvas").GetComponent <DeckTableController> (); if (DelBTN != null) { DelBTN.GetComponent <Button> ().onClick.AddListener(DelDeck); } if (ViewBTN != null) { ViewBTN.GetComponent <Button> ().onClick.AddListener(ViewDeck); } if (EditBTN != null) { EditBTN.GetComponent <Button> ().onClick.AddListener(EditDeck); } if (ThisButton != null) { ThisButton.GetComponent <Button> ().onClick.AddListener(PressDeck); } }
public void SelectDeck() { Debug.Log("Deck Selected"); if (PanelActive) { if (DeckAvailable) { if (Controller == null) { Controller = GameObject.Find("DeckSelect-Canvas").GetComponent <DeckTableController> (); } if (Controller.MainMenuComponent.DeckChooseMode) { Frame.color = SelectColor; //Deck.GetComponent<SmothTransform> ().SmoothScaleTo (new Vector3 (1.1f, 1.1f, 1.1f), 5); GetComponent <Animator>().SetBool("Select", true); ThisButton.GetComponent <SmothTransform> ().SmoothScaleTo(new Vector3(1.1f, 1.1f, 1.1f), 5); } } } }