public IEnumerator transitionOut(CutsceneSide side) { Image img; string animationName; bool isLeft = side == CutsceneSide.Left; if (isLeft) { img = leftImage; animationName = "CutsceneLeftCharacterOut"; } else { img = rightImage; animationName = "CutsceneRightCharacterOut"; } Animation anim = img.GetComponent <Animation>(); anim.Play(animationName); yield return(WaitForAnimation(anim)); if (isLeft) { leftCharacter = null; } else { rightCharacter = null; } }
public IEnumerator sayDialogue(CutsceneCharacter character, string dialogue) { focusSide(character); dialogue = character.name.ToUpper() + ": " + dialogue; dialogueText.text = dialogue; yield return(new WaitForSeconds(dialogue.Length * 0.04f + 1.5f)); }
public IEnumerator transitionIn(CutsceneCharacter character, CutsceneSide side) { Image img; string animationName; if (side == CutsceneSide.Left) { img = leftImage; animationName = "CutsceneLeftCharacterIn"; } else { img = rightImage; animationName = "CutsceneRightCharacterIn"; } img.sprite = character.currentExpression; Animation anim = img.GetComponent <Animation>(); anim.Play(animationName); yield return(WaitForAnimation(anim)); }
public IEnumerator setCharacter(CutsceneCharacter character, CutsceneSide side) { bool isLeft = (side == CutsceneSide.Left); CutsceneCharacter oldCharacter = isLeft ? leftCharacter : rightCharacter; if (oldCharacter != null) { yield return(transitionOut(side)); yield return(new WaitForSeconds(0.5f)); } if (isLeft) { leftCharacter = character; } else { rightCharacter = character; } yield return(transitionIn(character, side)); }
public void focusSide(CutsceneCharacter character) { CutsceneSide side = (character == leftCharacter) ? CutsceneSide.Left : CutsceneSide.Right; focusSide(side); }