Пример #1
0
    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);
    }
Пример #2
0
 private void PressDeck()
 {
     if (PanelActive)
     {
         if (DeckAvailable)
         {
             if (Controller == null)
             {
                 Controller = GameObject.Find("DeckSelect-Canvas").GetComponent <DeckTableController> ();
             }
             SelectDeck();
         }
         if (DeckAvailable)
         {
             Controller.ChooseDeck(index);
         }
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
 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);
             }
         }
     }
 }