public void Initialize(Card card, Transform handParent, CardBuildZone initialBuildZone) { this.card = card; this.handParent = handParent; lockedBuildZone = initialBuildZone; instantiatePlatformingBits(); AbilityText.text = card.Ability.ToString(); dragParent = handParent.parent; transform.SetParent(dragParent, true); if (initialBuildZone != null) { DummyLayoutElement.SetParent(dragParent, true); DummyLayoutElement.position = initialBuildZone.transform.position; } else { DummyLayoutElement.SetParent(handParent, false); } ScaleTransition.FlashFromTo(0, 1); }
void sendBackToHand() { if (lockedBuildZone != null) { lockedBuildZone.UnsetCard(); lockedBuildZone = null; } DummyLayoutElement.SetParent(handParent, false); }
void lockToBuildZone(CardBuildZone buildZone) { if (lockedBuildZone != null) { lockedBuildZone.UnsetCard(); } lockedBuildZone = buildZone; lockedBuildZone.SetCard(card); DummyLayoutElement.position = buildZone.transform.position; transform.SetAsFirstSibling(); }