Ejemplo n.º 1
0
        /// <summary>Resets the dialogue state</summary>
        public void Restore()
        {
            hasSwitched = false;

            activeDisplay?.SetActive(false);
            activeDisplay = null;
        }
Ejemplo n.º 2
0
        /// <summary>Tries Progresses the dialogue by switching display if necessary and dislay the next line on screen. Returns false if the end of monologues has been reached.</summary>
        public bool Continue(ref int indexAt)
        {
            indexAt++;

            if (indexAt == monologues.Length)
            {
                return(false);
            }

            if (hasSwitched)
            {
                activeDisplay.SetActive(false);
                activeDisplay = leftIsActive ? leftDisplay : rightDisplay;
                activeDisplay.SetActive(true);
                hasSwitched = false;
            }

            activeDisplay.text = monologues[indexAt].Line;

            if (monologues[indexAt].IsLast)
            {
                leftIsActive = !leftIsActive;
                hasSwitched  = true;
            }

            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>Resets the dialogue state</summary>
        public void Restore()
        {
            display?.SetActive(false);
            display = null;

            AnyActive = false;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// prepares the monologue to be played
        /// </summary>
        /// <param name="display"></param>
        public void SetupDisplay(AudableCharacterDisplay display)
        {
            AnyActive = true;

            this.display        = display;
            this.display.sprite = character.DisplaySprite;
        }
Ejemplo n.º 5
0
        /// <summary>Tries Progresses the dialogue by switching display if necessary and dislay the next line on screen. Returns false if the end of monologues has been reached.</summary>
        public bool Continue(AudableCharacterDisplay display, ref int indexAt)
        {
            indexAt++;

            if (indexAt == lines.Length)
            {
                return(false);
            }

            display.text = lines[indexAt];

            return(true);
        }
Ejemplo n.º 6
0
        public void SetupDisplay(AudableCharacterDisplay leftDisplay, AudableCharacterDisplay rightDisplay)
        {
            this.leftDisplay  = leftDisplay;
            this.rightDisplay = rightDisplay;

            leftDisplay.SetActive(false);
            rightDisplay.SetActive(false);

            leftDisplay.sprite  = leftCharacter.DisplaySprite;
            rightDisplay.sprite = rightCharacter.DisplaySprite;

            leftIsActive  = startLeft;
            activeDisplay = leftIsActive ? leftDisplay : rightDisplay;
        }