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 transitiong to that View will automatically activate the Page. [ExecuteInEditMode] public class Page : MonoBehaviour { public Bounds pageBounds = new Bounds(Vector3.zero, new Vector3(0.25f, 0.25f, 0f)); // The font size for title, say and option text is calculated by multiplying the screen height // by the corresponding font scale. Text appears the same size across all device resolutions. public float titleFontScale = 1f / 20f; public float sayFontScale = 1f / 25f; public float optionFontScale = 1f / 25f; public GUIStyle titleStyle; public GUIStyle sayStyle; public GUIStyle optionStyle; public GUIStyle boxStyle; string titleText = ""; string originalStoryText = ""; string displayedStoryText = ""; Action deferredAction; public enum Mode { Idle, Say, Choose }; Mode mode = Mode.Idle; class Option { public string optionText; public Action optionAction; public Option(string _optionText, Action _optionAction) { optionText = _optionText; optionAction = _optionAction; } } List