public void PushUnit(CardDisplay cardDisplay, Point position) { UnitDisplay unitDisplay = cardDisplay.UnitDisplay; unitDisplay.transform.DOLocalJump(PointerToIcometric(position, tileWidth, tileHeight), 0.5f, 1, 0.5f); this.UpdatePositions(unitDisplay, position); }
public CardSelectionData(CardSelectionData sel) { type = sel.type; card = sel.card; cardDisplay = sel.cardDisplay; place = sel.place; selected = sel.selected; }
public void RemoveCard(CardDisplay d) { if (cards.Contains(d)) { cards.Remove(d); } Debug.Log("card removed"); }
// public Bar bar; public CardSelectionData(CardDisplay _card = null, ICard cardData = null, SelectionType _type = null, bool _selected = false, CardPlace _place = null) { type = _type; card = cardData; cardDisplay = _card; place = _place; selected = _selected; }
public override void Execute(Vector2Int value, int power, CardDisplay cardDisplay) { DealDamageEvent e = Instantiate(damageEvent, BattleEventManager.Instance.transform); e.damage = GetFinalValue(value, power); e.target = EnemyArea.Instance.enemy; e.from = PlayerArea.Instance.player; }
public bool ContainCardAsLast(CardDisplay card) { if (column.Count > 0 && column[column.Count - 1] == card) { return(true); } return(false); }
public void AddCard(CardDisplay d) { if (!cards.Contains(d)) { cards.Add(d); } Debug.Log("card added"); }
public void addMana(int p) { GameObject p2C0Atk = GameObject.Find("P2Card " + p); CardDisplay a = p2C0Atk.GetComponent <CardDisplay>(); GameLevelManager.instance.activeManaCrystalsP2 = GameLevelManager.instance.activeManaCrystalsP2 + a.Amount; GameLevelManager.instance.manaTextP2.text = GameLevelManager.instance.activeManaCrystalsP2.ToString(); }
public CardDisplay CreateCardDisplayForCollection(CardData cardData, CardSlotUI cardSlotUI) { CardDisplay cardDisplay = CreateSimpleDisplay(cardData, cardSlotUI); CardVisualCollectionUINEW dbUI = cardDisplay.gameObject.AddComponent <CardVisualCollectionUINEW>(); dbUI.SetSlot(cardSlotUI); return(cardDisplay); }
public bool Contain(CardDisplay card) { if (deck.Contains(card)) { return(true); } return(false); }
protected override void EnteredEvent(Draggable d) { if (target != null) { CardDisplay card = d.gameObject.GetComponent <CardDisplay>(); card.effect.SetTarget(target); FSM.singleton.nextTurnButton.interactable = true; } }
public void SetData(RibbonData ribbonData, Action <RibbonData> OnRibbonClick, CardDisplay cardDisplay) { txtName.text = ribbonData.name; txtAmount.text = ribbonData.amount.ToString(); this.ribbonData = ribbonData; this.OnRibbonClick = OnRibbonClick; this.cardDisplay = cardDisplay; cardRect = cardDisplay.GetComponent <RectTransform>(); }
public CardDisplay CreateSimpleDisplay(CardData cardData, CardSlotUI cardSlotUI) { GameObject cardPrf = GameObject.Instantiate(cardPrefab, cardSlotUI.GetCardSlotTransform().GetChild(0)); CardDisplay cardDisplay = cardPrf.GetComponent <CardDisplay>(); cardDisplay.SetDisplay(cardData); cardSlotUI.SetCardDisplay(cardDisplay); return(cardDisplay); }
public CardDisplay CreateCardDisplayForDeckBuilder(CardData cardData, CardSlotUI cardSlotUI, DeckBuilderCreationManager deckBuilderCreationManager, ScrollRect cardScrollRectParent) { CardDisplay cardDisplay = CreateSimpleDisplay(cardData, cardSlotUI); DeckBuilderCardOnlyClickUINEW dbUI = cardDisplay.gameObject.AddComponent <DeckBuilderCardOnlyClickUINEW>(); dbUI.SetEvent(deckBuilderCreationManager.OnTryToAddCardToDeck, cardData, cardSlotUI); dbUI.SetScrollRect(cardScrollRectParent); return(cardDisplay); }
private void Start() { int CurrentSpawn = 0; float xPos = 0f; float yPos = 2f; float xAmount = 3f; for (int i = 0; i < 11; i++) { foreach (Card card in instance.cards) { if (card.manaCost == i) { switch (cardDisplayPosition) { case 0: xPos = -4.5f; break; case 1: xPos = xPos + xAmount; break; case 2: xPos = xPos + xAmount; break; case 3: xPos = xPos + xAmount; break; default: break; } cardDisplayPosition++; if (cardDisplayPosition > 3) { cardDisplayPosition = 0; } GameObject go = Instantiate(cardPrefab, new Vector3(xPos, yPos, 0), Quaternion.identity); CardDisplay display = go.GetComponent <CardDisplay>(); display.CardSetup(card); CurrentSpawn++; if (CurrentSpawn > 3) { yPos -= 4f; CurrentSpawn = 0; } } } } }
public virtual void Start() { gamemanager = FindObjectOfType <Gamemanager>(); display = FindObjectOfType <CardDisplay>(); playerSelection = FindObjectOfType <PlayerSelection>(); colorChange = FindObjectOfType <ColorChange>(); // colorChange.Start(); }
/** * Discard the card from the hand */ public void DiscardCard(CardDisplay card) { CardDisplayList.Remove(card); //check for a curse effect CheckCurseCard(card.card, false); //active visual effect StartCoroutine(card.transform.GetComponent <DragCardHandler>().PlayGoToDiscard()); }
public void InitializesCard() { Card card = LoadTestUnitCard(); Transform transform = new GameObject().transform; CardDisplay cardDisplay = CardDisplay.CreateCardDisplay(card, transform); Assert.IsNotNull(cardDisplay); Assert.AreEqual(cardDisplay.GetCard().cardName, "Wizard"); }
public override void Execute(Vector2Int value, int power, CardDisplay cardDisplay) { int discard = GetFinalValue(value, power); if (discard > 0) { Instantiate(discardCardEvent, BattleEventManager.Instance.transform).discardNumber = discard; } }
private void AddToCard(ICard cardData, CardDisplay cardDisplay) { CardEntity card = new CardEntity(); card.data = cardData; card.display = cardDisplay; cards.Add(card); numberChanged.Invoke(cards.Count); }
private void BuildCard(Card card, int displayIndex) { CardDisplay cardDisplay = cardDisplays[displayIndex]; cardDisplay.SetIcon(card.cardIcon); cardDisplay.SetBackground(card.cardBorder); cardDisplay.SetEnergyCostText(card.energyCost.ToString()); cardDisplay.SetDescriptionText(card.description); }
public override void Execute(Vector2Int value, int power, CardDisplay cardDisplay) { int draw = GetFinalValue(value, power); for (int i = 0; i < draw; i++) { Instantiate(createCardEvent, BattleEventManager.Instance.transform).card.data = card.battleData; } }
public void Add(CardBattleData data) { CardDisplay card = Instantiate(cardSelectDisplay, transform); card.data = data; card.SetUp(); cardList.Add(card); }
public void EmmitCardPlayAction(CardDisplay card, Point point) { Unibus.Dispatch <PlayCardAction>(ActionEmmiter.CARD_PLAY, new PlayCardAction { cardId = card.cardData.id, x = point.x.ToString(), y = point.y.ToString() }); }
/// <summary> /// 构造函数 /// 花色,牌权值 设定后不能修改 /// </summary> /// <param name="name">牌名</param> /// <param name="color">花色</param> /// <param name="weight">权重</param> /// /// <param name="belongTo">归属</param> public BaseCard(string name, int id, CardColors color, CardWeight weight, CardBelongTo belongTo, CardDisplay cardDisplay) { this.cardName = name; this.CardId = id; this.cardColor = color; this.cardWeight = weight; this.cardBelongTo = belongTo; this.cardDisplay = cardDisplay; }
public static void SetCardLocation(this GameObject gameObject, Enums.CardLocation cardLocation) { CardDisplay cardDisplay = gameObject.transform.GetComponent <CardDisplay>(); if (cardDisplay != null) { cardDisplay.card.LocationOfCard = cardLocation; } }
/** * Create a card gameObject in the hand and add it to the list * Use when a card is draw */ public void AddCard(BasicCard cardDraw) { CardDisplay cardDisplay = Instantiate(cardDisplayPrefab, this.transform).GetComponent <CardDisplay>(); //Set the display of the card cardDisplay.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(cardWidth, cardHeight); cardDisplay.UpdateCard(cardDraw); CardDisplayList.Add(cardDisplay); }
public override void Start() { Display = GetComponent <CardDisplay>(); for (int i = 0; i < Size; ++i) { Cards.Add(null); } CardActions.Add((CardData c) => Move(c)); }
/// <summary> /// Method to be called when only one card needs to be drawn /// </summary> /// <param name="obj">The method need a reference to the cardDisplay item to use for the new card</param> public void DrawCard(GameObject obj) { CardDisplay _cd = obj.GetComponent <CardDisplay>(); // Randomly select a card from the possible card list Card selectedCard = SelectCard(); _cd.SetCard(selectedCard); }
private void OnCardMouseExit(CardDisplay card) { if (card.UnitDisplay) { var tile = boardCreator.GetTileByUnit(card.UnitDisplay); tile.HighlightOff(); card.UnitDisplay.EnableTeamColor(); } }
void Start() { isActive = false; m_SpriteRenderer = gameObject.GetComponent<SpriteRenderer>(); if (isActive) { m_SpriteRenderer.color = activeColor; } else { m_SpriteRenderer.color = inactiveColor; } // m_srcs = GetComponents<AudioSource>(); // m_stoneSfx = m_srcs [0]; // m_glowSfx = m_srcs [1]; m_CardDisplay = DisplayControllerObj.GetComponent<CardDisplay> (); m_defaultColor = m_SpriteRenderer.color; }