using UnityEngine; using System; using System.Collections; using System.Collections.Generic; using System.Text.RegularExpressions; namespace Fungus { /** * A rectangular screen area for rendering story text. * Rooms may contain any number of Pages. * If a Page is a child of a View, then transitioning to that View will automatically activate the Page. */ [ExecuteInEditMode] public class Page : MonoBehaviour { /// Page alignment options public enum Layout { /// Use the full rect to display the page. FullSize, /// Resize to fit displayed text and snap to top of rect. FitToTop, /// Resize to fit displayed text and snap to middle of rect. FitToMiddle, /// Resize to fit displayed text and snap to bottom of rect. FitToBottom } /// Page position within bounds when display height is less than bounds height. public Layout layout = Layout.FullSize; string headerText = ""; string footerText = ""; string displayedStoryText = ""; string originalStoryText = ""; Action deferredAction; Action continueAction; public enum Mode { Idle, Say, Choose }; [HideInInspector] public Mode mode = Mode.Idle; class Option { public string optionText; public Action optionAction; public Option(string _optionText, Action _optionAction) { optionText = _optionText; optionAction = _optionAction; } } List