private IEnumerator DoIncant(int targetIndex) { var originalIncantationLineColor = incantationLine.color; this.currentIncantation = new List <GameMove>(); var t = 0f; while (t < 1) { this.incantationLine.color = Color.Lerp(originalIncantationLineColor, performingIncantation != null ? Color.white : Color.red, t); yield return(new WaitForEndOfFrame()); t += Time.deltaTime / glowTime; } this.incantationLine.color = originalIncantationLineColor; incantationLine.Clear(); if (performingIncantation != null) { var targetMark = characterMarks[targetIndex]; var character = Character.Create(performingIncantation.summon); character.transform.SetParent(characterHolder); characters.Add(character); SoundController.main.PlaySound("succeed"); characterMarkSlots[targetMark] = character; t = 0f; while (t < 1) { character.displayImage.color = Color.Lerp(Color.clear, Color.white, t); yield return(new WaitForEndOfFrame()); t += Time.deltaTime / 0.4f; } yield return(StartCoroutine(CheckBeef(character))); performingIncantation = null; } }
private void ClearIncantationPreview() { incantationPreview.Clear(); }