// Use this for initialization void Start() { _slot = GetComponentInChildren <CardSlot>(); _slot.GetComponent <CanvasGroup>().blocksRaycasts = false; _slot.GetComponent <CanvasGroup>().interactable = false; _finished = false; _animator = GetComponent <Animator>(); }
void FlipCardSlotDown(CardSlot mCardSlot) { float y = mCardSlot.GetComponent <Transform>().rotation.eulerAngles.y; float z = mCardSlot.GetComponent <Transform>().rotation.eulerAngles.z; Quaternion rot = transform.localRotation; rot.eulerAngles = new Vector3(-90f, y, z); mCardSlot.GetComponent <Transform> ().rotation = rot; }
void FlipCardSlotUp(CardSlot mCardSlot) { float y = mCardSlot.GetComponent <Transform>().rotation.eulerAngles.y; float z = mCardSlot.GetComponent <Transform>().rotation.eulerAngles.z; Quaternion rot = transform.localRotation; rot.eulerAngles = new Vector3(90f, y, z); Transform tTemp = mCardSlot.GetComponent <Transform> (); tTemp.rotation = rot; mCardSlot.TopCard().TargetTransform.rotation = rot; }
void FlipCardSlotUp(CardSlot mCardSlot) { //float y = mCardSlot.GetComponent<Transform>().rotation.eulerAngles.y; int number = Random.Range(0, 2); float y = number == 1?0f:-180f; float z = mCardSlot.GetComponent <Transform>().rotation.eulerAngles.z; Quaternion rot = transform.localRotation; rot.eulerAngles = new Vector3(90f, y, z); Transform tTemp = mCardSlot.GetComponent <Transform> (); tTemp.rotation = rot; mCardSlot.TopCard().TargetTransform.rotation = rot; }
public void OnEndDrag(PointerEventData eventData) { if (!currentCardDisplay.OnSlot && nearestCardSlot != null && nearestCardSlot.CanPutCard(currentCardDisplay)) { DeckManager.instance.DeleteFromPlayer(currentCardDisplay); nearestCardSlot.CardDisplay = currentCardDisplay; nearestCardSlot.GetComponent <SpriteRenderer>().color = new Color(0, 0, 0, 0); AudioManager.PlaySound("cardPlace2"); TransformHelper.SmoothMove(currentCardDisplay.transform, nearestCardSlot.transform.position); } else { TransformHelper.SmoothMove(currentCardDisplay.transform, startCoord); } }
public void SetEndPointAndCardSlot(Card card, CardSlot cardSlot) { endPoint = cardSlot.GetComponent <RectTransform>().localPosition; futureCardSlot = cardSlot; flyingCard.SetCard(card); cardSlot.SetCardFly(this); }
private void OnTriggerStay2D(Collider2D collision) { if (!currentCardDisplay.OnSlot && collision.tag == "CardSlot" && collision.GetComponent <CardSlot>().CanPutCard(currentCardDisplay)) { nearestCardSlot = collision.GetComponent <CardSlot>(); nearestCardSlot.GetComponent <SpriteRenderer>().color = new Color(0, 0, 0, 100f / 255); } }
private void UpdateCardHover(CardSlot newCard) { if (currentCardSlot != null) { currentCardSlot.GetComponent <CardSlot>().ReturnCardToSlot(); } newCard.GetComponent <CardSlot>().HoverCardInSlot(); currentCardSlot = newCard; }
public IEnumerator DisplayCoroutine(CardSlot mCardSlot) { DealInProgress++; cardCheveronCurrent = true; if (_currentCardSlot.CardList.Count == 0) { if (mCardSlot == _prior0CardSlot) { float x = _prior0CardSlot.GetComponent <Transform>().rotation.eulerAngles.x; if (x == 270f) { Debug.Log("x = " + x); FlipCardSlotUp(_prior0CardSlot); cardCheveronCurrent = false; } else { _currentCardSlot.AddCard(mCardSlot.TopCard()); cardCheveron0Lock = false; } } if (mCardSlot == _prior1CardSlot) { float x = _prior1CardSlot.GetComponent <Transform>().rotation.eulerAngles.x; if (x == 270f) { FlipCardSlotUp(_prior1CardSlot); cardCheveronCurrent = false; } else { _currentCardSlot.AddCard(mCardSlot.TopCard()); cardCheveron1Lock = false; } } if (mCardSlot == _prior2CardSlot) { float x = _prior2CardSlot.GetComponent <Transform> ().rotation.eulerAngles.x; if (x == 270f) { FlipCardSlotUp(_prior2CardSlot); cardCheveronCurrent = false; } else { _currentCardSlot.AddCard(mCardSlot.TopCard()); cardCheveron2Lock = false; } } if (mCardSlot == _prior3CardSlot) { float x = _prior3CardSlot.GetComponent <Transform>().rotation.eulerAngles.x; if (x == 270f) { FlipCardSlotUp(_prior3CardSlot); cardCheveronCurrent = false; } else { _currentCardSlot.AddCard(mCardSlot.TopCard()); cardCheveron3Lock = false; } } if (mCardSlot == _prior4CardSlot) { float x = _prior4CardSlot.GetComponent <Transform>().rotation.eulerAngles.x; if (x == 270f) { FlipCardSlotUp(_prior4CardSlot); cardCheveronCurrent = false; } else { _currentCardSlot.AddCard(mCardSlot.TopCard()); cardCheveron4Lock = false; } } if (mCardSlot == _prior5CardSlot) { float x = _prior5CardSlot.GetComponent <Transform>().rotation.eulerAngles.x; if (x == 270f) { FlipCardSlotUp(_prior5CardSlot); cardCheveronCurrent = false; } else { _currentCardSlot.AddCard(mCardSlot.TopCard()); cardCheveron5Lock = false; } } if (mCardSlot == _prior6CardSlot) { float x = _prior6CardSlot.GetComponent <Transform>().rotation.eulerAngles.x; if (x == 270f) { FlipCardSlotUp(_prior6CardSlot); cardCheveronCurrent = false; } else { _currentCardSlot.AddCard(mCardSlot.TopCard()); cardCheveron6Lock = false; } } yield return(new WaitForSeconds(CardStackDelay)); } // int collectiveFaceValue = _prior0CardSlot.FaceValue(); // collectiveFaceValue += _prior1CardSlot.FaceValue(); // collectiveFaceValue += _prior2CardSlot.FaceValue(); // collectiveFaceValue += _prior3CardSlot.FaceValue(); // collectiveFaceValue += _prior4CardSlot.FaceValue(); // collectiveFaceValue += _prior5CardSlot.FaceValue(); // collectiveFaceValue += _prior6CardSlot.FaceValue(); // collectiveFaceValue += _currentCardSlot.FaceValue(); TarotDealerUIInstance.FaceValueText.text = _currentCardSlot.FaceValue(); DealInProgress--; }