public CardBehaviour CreateCardIn(BattleCardWrapper card, SlotType slot = SlotType.Nowhere) { Debug.Log("instant"); GameObject cardGo = Instantiate(DefaultResources.GetPrefab(DefaultResources.PrefabType.BattleCard)); cardGo.GetComponent <BattleCardVisual>().Init(card, true); return(CardCreation(cardGo, slot)); }
private CardBehaviour AddCardToDeck(BattleCard card, string guid) { BattleCardWrapper wrapper = new BattleCardWrapper(card, guid); CardBehaviour cardBehaviour = CardsLayoutManager.Instance.CreateCardIn(wrapper, CardsLayoutManager.SlotType.Nowhere); CardsLayoutManager.Instance.MoveCardTo(cardBehaviour, CardsLayoutManager.SlotType.PlayerDeck, null, true); return(cardBehaviour); }
public void Init(BattleCardWrapper card, bool show) { base.Init(card.Card, card.Guid); foreach (ResourcePair val in card.Card.Resources) { for (int i = 0; i < val.Value; i++) { GameObject resourceIcon = Instantiate(DefaultResources.GetPrefab(DefaultResources.PrefabType.ResourceIcon)); resourceIcon.GetComponent <ResourceIcon>().Init(val.Resource, ResourcesSlot); resourceIcon.transform.localRotation = Quaternion.identity; } } foreach (Image panel in ColoringPanels) { panel.color = DefaultResources.GetCardColor(((BattleCard)card.Card).CardType); } }
private void TakeCardFromDeck(Player player, BattleCardWrapper cardWrapper) { Debug.Log("Take from deck"); ClientController.Instance.photonView.RPC("TakeCardFromDeck", RpcTarget.All, new object[] { player.ActorNumber, cardWrapper.CardId, cardWrapper.Guid }); }