Пример #1
0
 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;
 }
Пример #2
0
 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;
 }
Пример #3
0
 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;
 }
Пример #4
0
 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;
 }
Пример #5
0
 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);
 }
Пример #6
0
 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();
     }
 }
Пример #7
0
 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();
     }
 }
Пример #8
0
 public static void Engrave(CardView card)
 {
     card.GetCardData().state = CardState.Dead;
     instance.graveyard.Drop(card);
 }
Пример #9
0
 public static void Engrave(CardView card)
 {
     card.GetCardData().state = CardState.Dead;
     instance.graveyard.Drop(card);
 }