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; } }
public void RefreshIncantation() { performingIncantation = IncantationData.GetIncantationData(this.currentIncantation); }
public bool MatchDataMove(IncantationData.Move move) { var fromMarkIndex = circle.characterMarks.IndexOf(fromMark); var toMarkIndex = circle.characterMarks.IndexOf(toMark); var directionIsClockwise = Vector2Extensions.SignedAngle((fromMark.transform.position - circle.circleCenter.position), (toMark.transform.position - circle.circleCenter.position)) > 0; var direction = directionIsClockwise ? Direction.Clockwise : Direction.CounterClockwise; Debug.Log("Move Compare: " + type + " vs " + move.type + " dir: " + direction + " vs " + move.direction); return type == move.type && (type == MoveType.Cross || direction == move.direction); }
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; } }
public void RefreshIncantation() { performingIncantation = IncantationData.GetIncantationData(this.currentIncantation); }