public void PreviewCard(CardView view) { shadow.SetActive(true); card = view; AudioSource.PlayClipAtPoint(audioClip, Vector3.zero); prevParent = card.transform.parent; prevState = card.GetCardData().state; card.GetCardData().state = CardState.Preview; card.GetComponent <RectTransform>().SetParent(transform); card.transform.localPosition = Vector3.zero; prevRot = card.transform.localRotation; card.transform.localRotation = Quaternion.identity; card.transform.localScale = Vector3.one; }
public void PreviewCard(CardView view) { shadow.SetActive(true); card = view; AudioSource.PlayClipAtPoint(audioClip, Vector3.zero); prevParent = card.transform.parent; prevState = card.GetCardData().state; card.GetCardData().state = CardState.Preview; card.GetComponent<RectTransform>().SetParent(transform); card.transform.localPosition = Vector3.zero; prevRot = card.transform.localRotation; card.transform.localRotation = Quaternion.identity; card.transform.localScale = Vector3.one; }
public void AttachCard(CardView card) { card.Open(true); card.GetComponent <RectTransform>().SetParent(transform); card.GetComponent <RectTransform>().localPosition = Vector3.zero; card.GetComponent <RectTransform>().localRotation = Quaternion.identity; card.GetComponent <RectTransform>().localScale = Vector3.one; card.GetCardData().state = CardState.Arena; }
public void AttachCard(CardView card) { card.Open(true); card.GetComponent<RectTransform>().SetParent(transform); card.GetComponent<RectTransform>().localPosition = Vector3.zero; card.GetComponent<RectTransform>().localRotation = Quaternion.identity; card.GetComponent<RectTransform>().localScale = Vector3.one; card.GetCardData().state = CardState.Arena; }
public void OnPointerClick(PointerEventData eventData) { card.GetComponent <RectTransform>().SetParent(prevParent); card.transform.localPosition = Vector3.zero; card.transform.localRotation = prevRot; card.transform.localScale = Vector3.one; card.GetCardData().state = prevState; card = null; shadow.SetActive(false); }
public void PickCard(CardView card) { if (card.GetCardData().state == CardState.Stacked && TurnManager.IsCardDrawn()) { return; }else{ card.GetComponent<RectTransform>().SetParent(container.transform); card.GetComponent<RectTransform>().localRotation = Quaternion.identity; card.GetComponent<RectTransform>().localScale = Vector3.one; card.GetComponent<CardView>().GetCardData().state = CardState.Handed; TurnManager.SetCardDrawn(); } }
public void PickCard(CardView card) { if (card.GetCardData().state == CardState.Stacked && TurnManager.IsCardDrawn()) { return; } else { card.GetComponent <RectTransform>().SetParent(container.transform); card.GetComponent <RectTransform>().localRotation = Quaternion.identity; card.GetComponent <RectTransform>().localScale = Vector3.one; card.GetComponent <CardView>().GetCardData().state = CardState.Handed; TurnManager.SetCardDrawn(); } }
public static void Engrave(CardView card) { card.GetCardData().state = CardState.Dead; instance.graveyard.Drop(card); }