Exemple #1
0
        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;
            }
        }
Exemple #2
0
 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));
 }
Exemple #3
0
        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));
        }
Exemple #4
0
        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));
        }
Exemple #5
0
        public void focusSide(CutsceneCharacter character)
        {
            CutsceneSide side = (character == leftCharacter) ? CutsceneSide.Left : CutsceneSide.Right;

            focusSide(side);
        }