private void RPC_PlayerPickCard(int cardUniqueId, int photonId)
        {
            PlayerHolder currentPlayer = GetPlayer(photonId).ThisPlayer;
            Card         card          = currentPlayer.CardManager.SearchCard(cardUniqueId);

            if (card == null)
            {
                Debug.LogError("CardISNULL");
                return;
            }
            Debug.Log("AddCard");
            GameObject     go     = Instantiate(MainData.CardPrefab) as GameObject;
            CardAppearance visual = go.GetComponent <CardAppearance>();

            visual.LoadCard(card, go);
            card.Init(go);
            card.User = currentPlayer;
            MoveCardInstance.SetParentForCard(go.transform, currentPlayer.CardTransform.HandGrid.value);
            if (currentPlayer.CardManager.handCards.Count <= 7)
            {
                currentPlayer.CardManager.handCards.Add(card.GetCardData.UniqueId);
            }
            else
            {
                Setting.RegisterLog("Can't add card. Next card is deleted", Color.black);
            }
        }
Esempio n. 2
0
        public void LoadCard(Card c)         //Needed when loading card
        {
            GameObject     go = Instantiate(_CardPrefab) as GameObject;
            CardAppearance v  = go.GetComponent <CardAppearance>();

            if (v != null)
            {
                v.LoadCard(c, go);
                c.Init(go);
                c.User = Setting.gameController.LocalPlayer;
                c.User.CardManager.handCards.Add(c.GetCardData.UniqueId);
                go.transform.SetParent(_Hand.transform);
                go.transform.localPosition = Vector3.zero;
                go.transform.localScale    = Vector3.one;
            }
        }