private IEnumerator DecisionAnimationSequence(CardDecision decision) { DisableDrag(); DisableFlip(); AudioControl.PlayAudioFromSource(onDecisionAudioClip); float startTime = Time.time, overTime = 0.25f; Vector3 initScale = new Vector3(1.0f, 1.0f, 1.0f); Vector3 finalScale = new Vector3(2.0f, 2.0f, 2.0f); while (Time.time < startTime + overTime) { canvasGroup.alpha = Mathf.Lerp(1.0f, 0.0f, (Time.time - startTime) / overTime); transform.localScale = Vector3.Lerp(initScale, finalScale, (Time.time - startTime) / overTime); yield return(null); } GameManager.instance.player.ApplyDecisionEffects(decision); ReferencesManager.instance.leftDropZone.transform.Find("Decision").GetComponent <CanvasGroup>().alpha = 0; ReferencesManager.instance.rightDropZone.transform.Find("Decision").GetComponent <CanvasGroup>().alpha = 0; ReferencesManager.instance.deck.Discard(); if (ReferencesManager.instance.deck.cards.Count >= 0) { GameManager.instance.ValidateAttributes(); } yield return(new WaitForSeconds(0.1f)); ReferencesManager.instance.deck.Draw(); EnableDrag(); EnableFlip(); }
public void ApplyDecisionEffects(CardDecision decision) { foreach (CardEffect effect in decision.decisionEffects) { ApplyEffect(effect); } }
public void DoDecision(CardDecision decision) { StartCoroutine(DecisionAnimationSequence(decision)); }