diff --git a/Assets/Fungus/Resources/Sprites/HandPointer.png.meta b/Assets/Fungus/Resources/Sprites/HandPointer.png.meta index 5be1d7cf..62349f4b 100644 --- a/Assets/Fungus/Resources/Sprites/HandPointer.png.meta +++ b/Assets/Fungus/Resources/Sprites/HandPointer.png.meta @@ -7,8 +7,8 @@ TextureImporter: serializedVersion: 2 mipmaps: mipMapMode: 0 - enableMipMap: 1 - linearTexture: 0 + enableMipMap: 0 + linearTexture: 1 correctGamma: 0 fadeOut: 0 borderMipMap: 0 @@ -17,38 +17,42 @@ TextureImporter: bumpmap: convertToNormalMap: 0 externalNormalMap: 0 - heightScale: .25 + heightScale: 0.25 normalMapFilter: 0 - isReadable: 0 + isReadable: 1 grayScaleToAlpha: 0 generateCubemap: 0 cubemapConvolution: 0 cubemapConvolutionSteps: 8 cubemapConvolutionExponent: 1.5 seamlessCubemap: 0 - textureFormat: -1 - maxTextureSize: 2048 + textureFormat: -3 + maxTextureSize: 512 textureSettings: filterMode: -1 - aniso: -1 + aniso: 1 mipBias: -1 wrapMode: 1 nPOTScale: 0 lightmap: 0 rGBM: 0 compressionQuality: 50 - spriteMode: 1 + allowsAlphaSplitting: 0 + spriteMode: 0 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 - spritePivot: {x: .5, y: .5} + spritePivot: {x: 0.5, y: 0.5} spriteBorder: {x: 0, y: 0, z: 0, w: 0} spritePixelsToUnits: 100 alphaIsTransparency: 1 - textureType: 8 + spriteTessellationDetail: -1 + textureType: 7 buildTargetSettings: [] spriteSheet: + serializedVersion: 2 sprites: [] + outline: [] spritePackingTag: userData: assetBundleName: diff --git a/Assets/Fungus/Scripts/Commands/Else.cs b/Assets/Fungus/Scripts/Commands/Else.cs index 6b39c927..7af0fa6c 100644 --- a/Assets/Fungus/Scripts/Commands/Else.cs +++ b/Assets/Fungus/Scripts/Commands/Else.cs @@ -32,8 +32,8 @@ namespace Fungus.Commands int indent = indentLevel; for (int i = CommandIndex + 1; i < ParentBlock.CommandList.Count; ++i) { - ICommand command = ParentBlock.CommandList[i]; - + var command = ParentBlock.CommandList[i]; + if (command.IndentLevel == indent) { System.Type type = command.GetType(); diff --git a/Assets/Fungus/Scripts/Commands/ElseIf.cs b/Assets/Fungus/Scripts/Commands/ElseIf.cs index 1e1a118f..5c187e6a 100644 --- a/Assets/Fungus/Scripts/Commands/ElseIf.cs +++ b/Assets/Fungus/Scripts/Commands/ElseIf.cs @@ -40,7 +40,7 @@ namespace Fungus.Commands int indent = indentLevel; for (int i = CommandIndex + 1; i < ParentBlock.CommandList.Count; ++i) { - ICommand command = ParentBlock.CommandList[i]; + var command = ParentBlock.CommandList[i]; if (command.IndentLevel == indent) { diff --git a/Assets/Fungus/Scripts/Commands/FadeScreen.cs b/Assets/Fungus/Scripts/Commands/FadeScreen.cs index 877d6dbe..ff86f94a 100644 --- a/Assets/Fungus/Scripts/Commands/FadeScreen.cs +++ b/Assets/Fungus/Scripts/Commands/FadeScreen.cs @@ -33,7 +33,7 @@ namespace Fungus.Commands public override void OnEnter() { - ICameraController cameraController = CameraController.GetInstance(); + var cameraController = CameraController.GetInstance(); if (fadeTexture) { diff --git a/Assets/Fungus/Scripts/Commands/FadeToView.cs b/Assets/Fungus/Scripts/Commands/FadeToView.cs index d653df4f..b3be3249 100644 --- a/Assets/Fungus/Scripts/Commands/FadeToView.cs +++ b/Assets/Fungus/Scripts/Commands/FadeToView.cs @@ -65,7 +65,7 @@ namespace Fungus.Commands return; } - ICameraController cameraController = CameraController.GetInstance(); + var cameraController = CameraController.GetInstance(); if (fadeTexture) { diff --git a/Assets/Fungus/Scripts/Commands/Menu.cs b/Assets/Fungus/Scripts/Commands/Menu.cs index 377faaa4..2dd72482 100644 --- a/Assets/Fungus/Scripts/Commands/Menu.cs +++ b/Assets/Fungus/Scripts/Commands/Menu.cs @@ -41,14 +41,14 @@ namespace Fungus.Commands if (setMenuDialog != null) { // Override the active menu dialog - MenuDialog.activeMenuDialog = setMenuDialog; + MenuDialog.ActiveMenuDialog = setMenuDialog; } bool hideOption = (hideIfVisited && targetBlock != null && targetBlock.GetExecutionCount() > 0); if (!hideOption) { - IMenuDialog menuDialog = MenuDialog.GetMenuDialog(); + var menuDialog = MenuDialog.GetMenuDialog(); if (menuDialog != null) { menuDialog.SetActive(true); diff --git a/Assets/Fungus/Scripts/Commands/MenuTimer.cs b/Assets/Fungus/Scripts/Commands/MenuTimer.cs index bdca678f..32d83a83 100644 --- a/Assets/Fungus/Scripts/Commands/MenuTimer.cs +++ b/Assets/Fungus/Scripts/Commands/MenuTimer.cs @@ -27,7 +27,7 @@ namespace Fungus.Commands public override void OnEnter() { - IMenuDialog menuDialog = MenuDialog.GetMenuDialog(); + var menuDialog = MenuDialog.GetMenuDialog(); if (menuDialog != null && targetBlock != null) diff --git a/Assets/Fungus/Scripts/Commands/MoveToView.cs b/Assets/Fungus/Scripts/Commands/MoveToView.cs index 18f2a5c7..9055f551 100644 --- a/Assets/Fungus/Scripts/Commands/MoveToView.cs +++ b/Assets/Fungus/Scripts/Commands/MoveToView.cs @@ -56,7 +56,7 @@ namespace Fungus.Commands return; } - ICameraController cameraController = CameraController.GetInstance(); + var cameraController = CameraController.GetInstance(); Vector3 targetPosition = targetView.transform.position; Quaternion targetRotation = targetView.transform.rotation; diff --git a/Assets/Fungus/Scripts/Commands/PlayMusic.cs b/Assets/Fungus/Scripts/Commands/PlayMusic.cs index e3fc5760..005f2be2 100644 --- a/Assets/Fungus/Scripts/Commands/PlayMusic.cs +++ b/Assets/Fungus/Scripts/Commands/PlayMusic.cs @@ -28,7 +28,7 @@ namespace Fungus.Commands public override void OnEnter() { - IMusicController musicController = MusicController.GetInstance(); + var musicController = MusicController.GetInstance(); if (musicController != null) { float startTime = Mathf.Max(0, atTime); diff --git a/Assets/Fungus/Scripts/Commands/PlaySound.cs b/Assets/Fungus/Scripts/Commands/PlaySound.cs index 2fa09327..14613641 100644 --- a/Assets/Fungus/Scripts/Commands/PlaySound.cs +++ b/Assets/Fungus/Scripts/Commands/PlaySound.cs @@ -32,7 +32,7 @@ namespace Fungus.Commands return; } - IMusicController musicController = MusicController.GetInstance(); + var musicController = MusicController.GetInstance(); if (musicController != null) { musicController.PlaySound(soundClip, volume); diff --git a/Assets/Fungus/Scripts/Commands/Say.cs b/Assets/Fungus/Scripts/Commands/Say.cs index 2e660900..fe1af4eb 100644 --- a/Assets/Fungus/Scripts/Commands/Say.cs +++ b/Assets/Fungus/Scripts/Commands/Say.cs @@ -69,16 +69,15 @@ namespace Fungus.Commands // Override the active say dialog if needed if (character != null && character.SetSayDialog != null) { - SayDialog.activeSayDialog = character.SetSayDialog; + SayDialog.ActiveSayDialog = character.SetSayDialog; } if (setSayDialog != null) { - SayDialog.activeSayDialog = setSayDialog; + SayDialog.ActiveSayDialog = setSayDialog; } - ISayDialog sayDialog = SayDialog.GetSayDialog(); - + var sayDialog = SayDialog.GetSayDialog(); if (sayDialog == null) { Continue(); @@ -136,7 +135,7 @@ namespace Fungus.Commands public override void OnStopExecuting() { - ISayDialog sayDialog = SayDialog.GetSayDialog(); + var sayDialog = SayDialog.GetSayDialog(); if (sayDialog == null) { return; diff --git a/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs b/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs index 584ca98e..c7664e07 100644 --- a/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs +++ b/Assets/Fungus/Scripts/Commands/SetAudioPitch.cs @@ -34,7 +34,7 @@ namespace Fungus.Commands } }; - IMusicController musicController = MusicController.GetInstance(); + var musicController = MusicController.GetInstance(); if (musicController != null) { musicController.SetAudioPitch(pitch, fadeDuration, onComplete); diff --git a/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs b/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs index 0cc33d48..e0b44fe0 100644 --- a/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs +++ b/Assets/Fungus/Scripts/Commands/SetAudioVolume.cs @@ -27,7 +27,7 @@ namespace Fungus.Commands public override void OnEnter() { - IMusicController musicController = MusicController.GetInstance(); + var musicController = MusicController.GetInstance(); if (musicController != null) { musicController.SetAudioVolume(volume, fadeDuration, () => { diff --git a/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs b/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs index 152191f1..0661f512 100644 --- a/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs +++ b/Assets/Fungus/Scripts/Commands/SetMenuDialog.cs @@ -21,7 +21,7 @@ namespace Fungus.Commands { if (menuDialog != null) { - MenuDialog.activeMenuDialog = menuDialog; + MenuDialog.ActiveMenuDialog = menuDialog; } Continue(); diff --git a/Assets/Fungus/Scripts/Commands/SetSayDialog.cs b/Assets/Fungus/Scripts/Commands/SetSayDialog.cs index cb088169..b7662546 100644 --- a/Assets/Fungus/Scripts/Commands/SetSayDialog.cs +++ b/Assets/Fungus/Scripts/Commands/SetSayDialog.cs @@ -21,7 +21,7 @@ namespace Fungus.Commands { if (sayDialog != null) { - SayDialog.activeSayDialog = sayDialog; + SayDialog.ActiveSayDialog = sayDialog; } Continue(); diff --git a/Assets/Fungus/Scripts/Commands/StartSwipe.cs b/Assets/Fungus/Scripts/Commands/StartSwipe.cs index f7d311b7..3bd6d6b5 100644 --- a/Assets/Fungus/Scripts/Commands/StartSwipe.cs +++ b/Assets/Fungus/Scripts/Commands/StartSwipe.cs @@ -51,7 +51,7 @@ namespace Fungus.Commands return; } - ICameraController cameraController = CameraController.GetInstance(); + var cameraController = CameraController.GetInstance(); cameraController.StartSwipePan(targetCamera, viewA, viewB, duration, speedMultiplier, () => Continue() ); } diff --git a/Assets/Fungus/Scripts/Commands/StopBlock.cs b/Assets/Fungus/Scripts/Commands/StopBlock.cs index c04dee4f..2f6a5e91 100644 --- a/Assets/Fungus/Scripts/Commands/StopBlock.cs +++ b/Assets/Fungus/Scripts/Commands/StopBlock.cs @@ -32,7 +32,7 @@ namespace Fungus.Commands flowchart = (Flowchart)GetFlowchart(); } - IBlock block = flowchart.FindBlock(blockName.Value); + var block = flowchart.FindBlock(blockName.Value); if (block == null || !block.IsExecuting()) { diff --git a/Assets/Fungus/Scripts/Commands/StopFlowchart.cs b/Assets/Fungus/Scripts/Commands/StopFlowchart.cs index 31ad961f..9486adad 100644 --- a/Assets/Fungus/Scripts/Commands/StopFlowchart.cs +++ b/Assets/Fungus/Scripts/Commands/StopFlowchart.cs @@ -23,14 +23,14 @@ namespace Fungus.Commands public override void OnEnter() { - IFlowchart flowchart = GetFlowchart(); + var flowchart = GetFlowchart(); if (stopParentFlowchart) { flowchart.StopAllBlocks(); } - foreach (IFlowchart f in targetFlowcharts) + foreach (var f in targetFlowcharts) { if (f == flowchart) { diff --git a/Assets/Fungus/Scripts/Commands/StopMusic.cs b/Assets/Fungus/Scripts/Commands/StopMusic.cs index 11d120c4..167a7444 100644 --- a/Assets/Fungus/Scripts/Commands/StopMusic.cs +++ b/Assets/Fungus/Scripts/Commands/StopMusic.cs @@ -16,7 +16,7 @@ namespace Fungus.Commands { public override void OnEnter() { - IMusicController musicController = MusicController.GetInstance(); + var musicController = MusicController.GetInstance(); if (musicController != null) { musicController.StopMusic(); diff --git a/Assets/Fungus/Scripts/Commands/StopSwipe.cs b/Assets/Fungus/Scripts/Commands/StopSwipe.cs index bc6b5f94..69706372 100644 --- a/Assets/Fungus/Scripts/Commands/StopSwipe.cs +++ b/Assets/Fungus/Scripts/Commands/StopSwipe.cs @@ -16,7 +16,7 @@ namespace Fungus.Commands { public override void OnEnter() { - ICameraController cameraController = CameraController.GetInstance(); + var cameraController = CameraController.GetInstance(); cameraController.StopSwipePan(); diff --git a/Assets/Fungus/Scripts/Commands/Write.cs b/Assets/Fungus/Scripts/Commands/Write.cs index eb0599f8..cd801621 100644 --- a/Assets/Fungus/Scripts/Commands/Write.cs +++ b/Assets/Fungus/Scripts/Commands/Write.cs @@ -51,9 +51,9 @@ namespace Fungus.Commands [SerializeField] protected ColorData setColor = new ColorData(Color.white); - protected IWriter GetWriter() + protected Writer GetWriter() { - IWriter writer = textObject.GetComponent(); + var writer = textObject.GetComponent(); if (writer == null) { writer = textObject.AddComponent(); @@ -70,7 +70,7 @@ namespace Fungus.Commands return; } - IWriter writer = GetWriter(); + var writer = GetWriter(); if (writer == null) { Continue(); diff --git a/Assets/Fungus/Scripts/Components/Block.cs b/Assets/Fungus/Scripts/Components/Block.cs index cdf79a33..41278dfd 100644 --- a/Assets/Fungus/Scripts/Components/Block.cs +++ b/Assets/Fungus/Scripts/Components/Block.cs @@ -11,13 +11,24 @@ using Fungus.Utils; namespace Fungus { + /// + /// Execution state of a Block. + /// + public enum ExecutionState + { + /// No command executing + Idle, + /// Executing a command + Executing, + } + /// /// A container for a sequence of Fungus comands. /// [ExecuteInEditMode] [RequireComponent(typeof(Flowchart))] [AddComponentMenu("")] - public class Block : Node, IBlock + public class Block : Node { [SerializeField] protected int itemId = -1; // Invalid flowchart item id @@ -63,7 +74,7 @@ namespace Fungus // Give each child command a reference back to its parent block // and tell each command its index in the list. int index = 0; - foreach (ICommand command in commandList) + foreach (var command in commandList) { if (command == null) { @@ -89,7 +100,7 @@ namespace Fungus protected virtual void Update() { int index = 0; - foreach (ICommand command in commandList) + foreach (var command in commandList) { if (command == null) // Null entry will be deleted automatically later { @@ -101,46 +112,91 @@ namespace Fungus } #endif - #region IBlock implementation + #region Public methods + /// + /// The execution state of the Block. + /// public virtual ExecutionState State { get { return executionState; } } + /// + /// Unique identifier for the Block. + /// public virtual int ItemId { get { return itemId; } set { itemId = value; } } + /// + /// The name of the block node as displayed in the Flowchart window. + /// public virtual string BlockName { get { return blockName; } set { blockName = value; } } + /// + /// Description text to display under the block node + /// public virtual string Description { get { return description; } } + /// + /// An optional Event Handler which can execute the block when an event occurs. + /// Note: Using the concrete class instead of the interface here because of weird editor behaviour. + /// public virtual EventHandler _EventHandler { get { return eventHandler; } set { eventHandler = value; } } + /// + /// The currently executing command. + /// public virtual Command ActiveCommand { get { return activeCommand; } } + /// + /// Timer for fading Block execution icon. + /// public virtual float ExecutingIconTimer { get; set; } + /// + /// The list of commands in the sequence. + /// public virtual List CommandList { get { return commandList; } } + /// + /// Controls the next command to execute in the block execution coroutine. + /// public virtual int JumpToCommandIndex { set { jumpToCommandIndex = value; } } - public virtual IFlowchart GetFlowchart() + /// + /// Returns the parent Flowchart for this Block. + /// + public virtual Flowchart GetFlowchart() { - return GetComponent(); + return GetComponent(); } + /// + /// Returns true if the Block is executing a command. + /// public virtual bool IsExecuting() { return (executionState == ExecutionState.Executing); } + /// + /// Returns the number of times this Block has executed. + /// public virtual int GetExecutionCount() { return executionCount; } + /// + /// Start a coroutine which executes all commands in the Block. Only one running instance of each Block is permitted. + /// public virtual void StartExecution() { StartCoroutine(Execute()); } + /// + /// A coroutine method that executes all commands in the Block. Only one running instance of each Block is permitted. + /// + /// Index of command to start execution at + /// Delegate function to call when execution completes public virtual IEnumerator Execute(int commandIndex = 0, Action onComplete = null) { if (executionState != ExecutionState.Idle) @@ -249,6 +305,9 @@ namespace Fungus } } + /// + /// Stop executing commands in this Block. + /// public virtual void Stop() { // Tell the executing command to stop immediately @@ -262,6 +321,9 @@ namespace Fungus jumpToCommandIndex = int.MaxValue; } + /// + /// Returns a list of all Blocks connected to this one. + /// public virtual List GetConnectedBlocks() { var connectedBlocks = new List(); @@ -275,6 +337,10 @@ namespace Fungus return connectedBlocks; } + /// + /// Returns the type of the previously executing command. + /// + /// The previous active command type. public virtual System.Type GetPreviousActiveCommandType() { if (previousActiveCommandIndex >= 0 && @@ -286,10 +352,13 @@ namespace Fungus return null; } + /// + /// Recalculate the indent levels for all commands in the list. + /// public virtual void UpdateIndentLevels() { int indentLevel = 0; - foreach (ICommand command in commandList) + foreach (var command in commandList) { if (command == null) { diff --git a/Assets/Fungus/Scripts/Components/CameraController.cs b/Assets/Fungus/Scripts/Components/CameraController.cs index 23b35000..746ec9cb 100644 --- a/Assets/Fungus/Scripts/Components/CameraController.cs +++ b/Assets/Fungus/Scripts/Components/CameraController.cs @@ -9,7 +9,10 @@ using Fungus; namespace Fungus { - public class CameraController : MonoBehaviour, ICameraController + /// + /// Controller for main camera.Supports several types of camera transition including snap, pan & fade. + /// + public class CameraController : MonoBehaviour { [Tooltip("Full screen texture used for screen fade effect.")] [SerializeField] protected Texture2D screenFadeTexture; @@ -48,13 +51,13 @@ namespace Fungus protected Dictionary storedViews = new Dictionary(); - protected static ICameraController instance; + protected static CameraController instance; /// /// Returns the CameraController singleton instance. /// Will create a CameraController game object if none currently exists. /// - static public ICameraController GetInstance() + static public CameraController GetInstance() { if (instance == null) { @@ -65,20 +68,6 @@ namespace Fungus return instance; } - public static Texture2D CreateColorTexture(Color color, int width, int height) - { - Color[] pixels = new Color[width * height]; - for (int i = 0; i < pixels.Length; i++) - { - pixels[i] = color; - } - Texture2D texture = new Texture2D(width, height, TextureFormat.ARGB32, false); - texture.SetPixels(pixels); - texture.Apply(); - - return texture; - } - protected virtual void OnGUI() { if (swipePanActive) @@ -361,15 +350,42 @@ namespace Fungus return cameraSize; } - #region ICameraController implementation + #region Public methods + + /// + /// Creates a flat colored texture. + /// + public static Texture2D CreateColorTexture(Color color, int width, int height) + { + Color[] pixels = new Color[width * height]; + for (int i = 0; i < pixels.Length; i++) + { + pixels[i] = color; + } + Texture2D texture = new Texture2D(width, height, TextureFormat.ARGB32, false); + texture.SetPixels(pixels); + texture.Apply(); + return texture; + } + + /// + /// Full screen texture used for screen fade effect. + /// + /// The screen fade texture. public Texture2D ScreenFadeTexture { set { screenFadeTexture = value; } } + /// + /// Perform a fullscreen fade over a duration. + /// public virtual void Fade(float targetAlpha, float fadeDuration, Action fadeAction) { StartCoroutine(FadeInternal(targetAlpha, fadeDuration, fadeAction)); } + /// + /// Fade out, move camera to view and then fade back in. + /// public virtual void FadeToView(Camera camera, View view, float fadeDuration, bool fadeOut, Action fadeAction) { swipePanActive = false; @@ -405,11 +421,17 @@ namespace Fungus }); } + /// + /// Stop all camera tweening. + /// public virtual void Stop() { StopAllCoroutines(); } + /// + /// Moves camera from current position to a target position over a period of time. + /// public virtual void PanToPosition(Camera camera, Vector3 targetPosition, Quaternion targetRotation, float targetSize, float duration, Action arriveAction) { if (camera == null) @@ -443,6 +465,9 @@ namespace Fungus } } + /// + /// Activates swipe panning mode. The player can pan the camera within the area between viewA & viewB. + /// public virtual void StartSwipePan(Camera camera, View viewA, View viewB, float duration, float speedMultiplier, Action arriveAction) { if (camera == null) @@ -472,6 +497,9 @@ namespace Fungus }); } + /// + /// Deactivates swipe panning mode. + /// public virtual void StopSwipePan() { swipePanActive = false; diff --git a/Assets/Fungus/Scripts/Components/Character.cs b/Assets/Fungus/Scripts/Components/Character.cs index 2f7c6f94..45d1125b 100644 --- a/Assets/Fungus/Scripts/Components/Character.cs +++ b/Assets/Fungus/Scripts/Components/Character.cs @@ -13,7 +13,7 @@ namespace Fungus /// A Character that can be used in dialogue via the Say, Conversation and Portrait commands. /// [ExecuteInEditMode] - public class Character : MonoBehaviour, ICharacter, ILocalizable + public class Character : MonoBehaviour, ILocalizable { [Tooltip("Character name as displayed in Say Dialog.")] [SerializeField] protected string nameText; // We need a separate name as the object name is used for character variations (e.g. "Smurf Happy", "Smurf Sad") @@ -54,32 +54,69 @@ namespace Fungus activeCharacters.Remove(this); } - #region ICharacter implementation + #region Public methods + /// + /// Character name as displayed in Say Dialog. + /// public virtual string NameText { get { return nameText; } } + /// + /// Color to display the character name in Say Dialog. + /// public virtual Color NameColor { get { return nameColor; } } + /// + /// Sound effect to play when this character is speaking. + /// + /// The sound effect. public virtual AudioClip SoundEffect { get { return soundEffect; } } - public virtual Sprite ProfileSprite { get; set; } - + /// + /// List of portrait images that can be displayed for this character. + /// public virtual List Portraits { get { return portraits; } } + /// + /// Direction that portrait sprites face. + /// public virtual FacingDirection PortraitsFace { get { return portraitsFace; } } + /// + /// Currently display profile sprite for this character. + /// + /// The profile sprite. + public virtual Sprite ProfileSprite { get; set; } + + /// + /// Current display state of this character's portrait. + /// + /// The state. public virtual PortraitState State { get { return portaitState; } } - public virtual ISayDialog SetSayDialog { get { return setSayDialog; } } + /// + /// Sets the active Say dialog with a reference to a Say Dialog object in the scene. This Say Dialog will be used whenever the character speaks. + /// + public virtual SayDialog SetSayDialog { get { return setSayDialog; } } + /// + /// Returns the name of the game object. + /// public string GetObjectName() { return gameObject.name; } + /// + /// Returns true if the character name starts with the specified string. Case insensitive. + /// public virtual bool NameStartsWith(string matchString) { return name.StartsWith(matchString, true, System.Globalization.CultureInfo.CurrentCulture) || nameText.StartsWith(matchString, true, System.Globalization.CultureInfo.CurrentCulture); } + /// + /// Looks for a portrait by name on a character + /// If none is found, give a warning and return a blank sprite + /// public virtual Sprite GetPortrait(string portraitString) { if (String.IsNullOrEmpty(portraitString)) diff --git a/Assets/Fungus/Scripts/Components/Clickable2D.cs b/Assets/Fungus/Scripts/Components/Clickable2D.cs index f557f950..02f28daa 100644 --- a/Assets/Fungus/Scripts/Components/Clickable2D.cs +++ b/Assets/Fungus/Scripts/Components/Clickable2D.cs @@ -13,7 +13,7 @@ namespace Fungus /// The Game Object must have a Collider or Collider2D component attached. /// Use in conjunction with the ObjectClicked Flowchart event handler. /// - public class Clickable2D : MonoBehaviour, IClickable2D, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler + public class Clickable2D : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler { [Tooltip("Is object clicking enabled")] [SerializeField] protected bool clickEnabled = true; @@ -88,8 +88,11 @@ namespace Fungus #endregion - #region IClickable2D implementation + #region Public methods + /// + /// Is object clicking enabled. + /// public bool ClickEnabled { set { clickEnabled = value; } } #endregion diff --git a/Assets/Fungus/Scripts/Components/Command.cs b/Assets/Fungus/Scripts/Components/Command.cs index 059af20f..a81480e5 100644 --- a/Assets/Fungus/Scripts/Components/Command.cs +++ b/Assets/Fungus/Scripts/Components/Command.cs @@ -37,7 +37,7 @@ namespace Fungus /// /// Base class for Commands. Commands can be added to Blocks to create an execution sequence. /// - public class Command : MonoBehaviour, ICommand + public abstract class Command : MonoBehaviour { [FormerlySerializedAs("commandId")] [HideInInspector] @@ -48,7 +48,7 @@ namespace Fungus protected string errorMessage = ""; - #region ICommand implementation + #region Public methods /// /// Unique identifier for this command. @@ -92,13 +92,13 @@ namespace Fungus /// /// Returns the Flowchart that this command belongs to. /// - public virtual IFlowchart GetFlowchart() + public virtual Flowchart GetFlowchart() { - IFlowchart flowchart = GetComponent(); + var flowchart = GetComponent(); if (flowchart == null && transform.parent != null) { - flowchart = transform.parent.GetComponent(); + flowchart = transform.parent.GetComponent(); } return flowchart; } @@ -267,7 +267,7 @@ namespace Fungus public virtual string GetFlowchartLocalizationId() { // If no localization id has been set then use the Flowchart name - IFlowchart flowchart = GetFlowchart(); + var flowchart = GetFlowchart(); if (flowchart == null) { return ""; diff --git a/Assets/Fungus/Scripts/Components/CustomTag.cs b/Assets/Fungus/Scripts/Components/CustomTag.cs index f4c283ef..0c169746 100644 --- a/Assets/Fungus/Scripts/Components/CustomTag.cs +++ b/Assets/Fungus/Scripts/Components/CustomTag.cs @@ -10,7 +10,7 @@ namespace Fungus /// Create custom tags for use in Say text. /// [ExecuteInEditMode] - public class CustomTag : MonoBehaviour, ICustomTag + public class CustomTag : MonoBehaviour { [Tooltip("String that defines the start of the tag.")] [SerializeField] protected string tagStartSymbol; @@ -39,14 +39,26 @@ namespace Fungus activeCustomTags.Remove(this); } - #region ICustomTag implementation + #region Public methods + /// + /// String that defines the start of the tag. + /// public virtual string TagStartSymbol { get { return tagStartSymbol; } } + /// + /// String that defines the end of the tag. + /// public virtual string TagEndSymbol { get { return tagEndSymbol; } } + /// + /// String to replace the start tag with. + /// public virtual string ReplaceTagStartWith { get { return replaceTagStartWith; } } + /// + /// String to replace the end tag with. + /// public virtual string ReplaceTagEndWith { get { return replaceTagEndWith; } } #endregion diff --git a/Assets/Fungus/Scripts/Components/DialogInput.cs b/Assets/Fungus/Scripts/Components/DialogInput.cs index cbbe69bd..b9a5b2f5 100644 --- a/Assets/Fungus/Scripts/Components/DialogInput.cs +++ b/Assets/Fungus/Scripts/Components/DialogInput.cs @@ -24,7 +24,7 @@ namespace Fungus /// /// Input handler for say dialogs. /// - public class DialogInput : MonoBehaviour, IDialogInput + public class DialogInput : MonoBehaviour { [Tooltip("Click to advance story")] [SerializeField] protected ClickMode clickMode; @@ -102,9 +102,9 @@ namespace Fungus if (ignoreMenuClicks) { // Ignore input events if a Menu is being displayed - if (MenuDialog.activeMenuDialog != null && - MenuDialog.activeMenuDialog.IsActive() && - MenuDialog.activeMenuDialog.DisplayedOptionsCount > 0) + if (MenuDialog.ActiveMenuDialog != null && + MenuDialog.ActiveMenuDialog.IsActive() && + MenuDialog.ActiveMenuDialog.DisplayedOptionsCount > 0) { dialogClickedFlag = false; nextLineInputFlag = false; @@ -123,14 +123,20 @@ namespace Fungus } } - #region IDialogInput + #region Public methods - public void SetNextLineFlag() + /// + /// Trigger next line input event from script. + /// + public virtual void SetNextLineFlag() { nextLineInputFlag = true; } - public void SetDialogClickedFlag() + /// + /// Set the dialog clicked flag (usually from an Event Trigger component in the dialog UI). + /// + public virtual void SetDialogClickedFlag() { // Ignore repeat clicks for a short time to prevent accidentally clicking through the character dialogue if (ignoreClickTimer > 0f) @@ -146,7 +152,10 @@ namespace Fungus } } - public void SetButtonClickedFlag() + /// + /// Sets the button clicked flag. + /// + public virtual void SetButtonClickedFlag() { // Only applies if clicking is not disabled if (clickMode != ClickMode.Disabled) diff --git a/Assets/Fungus/Scripts/Components/Draggable2D.cs b/Assets/Fungus/Scripts/Components/Draggable2D.cs index 641c1f10..8516d9d2 100644 --- a/Assets/Fungus/Scripts/Components/Draggable2D.cs +++ b/Assets/Fungus/Scripts/Components/Draggable2D.cs @@ -16,7 +16,7 @@ namespace Fungus /// The RigidBody would typically have the Is Kinematic property set to true, unless you want the object to move around using physics. /// Use in conjunction with the Drag Started, Drag Completed, Drag Cancelled, Drag Entered & Drag Exited event handlers. /// - public class Draggable2D : MonoBehaviour, IDraggable2D, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerEnterHandler, IPointerExitHandler + public class Draggable2D : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerEnterHandler, IPointerExitHandler { [Tooltip("Is object dragging enabled")] [SerializeField] protected bool dragEnabled = true; @@ -232,8 +232,12 @@ namespace Fungus #endregion - #region IDraggable2D implementation + #region Public methods + /// + /// Is object drag and drop enabled. + /// + /// true if drag enabled; otherwise, false. public virtual bool DragEnabled { get { return dragEnabled; } set { dragEnabled = value; } } #endregion diff --git a/Assets/Fungus/Scripts/Components/EventHandler.cs b/Assets/Fungus/Scripts/Components/EventHandler.cs index 6699cc39..c40925b6 100644 --- a/Assets/Fungus/Scripts/Components/EventHandler.cs +++ b/Assets/Fungus/Scripts/Components/EventHandler.cs @@ -35,16 +35,22 @@ namespace Fungus [RequireComponent(typeof(Block))] [RequireComponent(typeof(Flowchart))] [AddComponentMenu("")] - public class EventHandler : MonoBehaviour, IEventHandler + public class EventHandler : MonoBehaviour { [HideInInspector] [FormerlySerializedAs("parentSequence")] [SerializeField] protected Block parentBlock; - #region IEventHandler + #region Public methods + /// + /// The parent Block which owns this Event Handler. + /// public virtual Block ParentBlock { get { return parentBlock; } set { parentBlock = value; } } + /// + /// The Event Handler should call this method when the event is detected to start executing the Block. + /// public virtual bool ExecuteBlock() { if (ParentBlock == null) @@ -68,6 +74,9 @@ namespace Fungus return flowchart.ExecuteBlock(ParentBlock); } + /// + /// Returns custom summary text for the event handler. + /// public virtual string GetSummary() { return ""; diff --git a/Assets/Fungus/Scripts/Components/Flowchart.cs b/Assets/Fungus/Scripts/Components/Flowchart.cs index ba50bae0..c359b56e 100644 --- a/Assets/Fungus/Scripts/Components/Flowchart.cs +++ b/Assets/Fungus/Scripts/Components/Flowchart.cs @@ -21,7 +21,7 @@ namespace Fungus /// Flowchart objects may be edited visually using the Flowchart editor window. /// [ExecuteInEditMode] - public class Flowchart : MonoBehaviour, IFlowchart, ISubstitutionHandler + public class Flowchart : MonoBehaviour, ISubstitutionHandler { [HideInInspector] [SerializeField] protected int version = 0; // Default to 0 to always trigger an update for older versions of Fungus. @@ -86,28 +86,12 @@ namespace Fungus [Tooltip("The ExecuteLua command adds a global Lua variable with this name bound to the flowchart prior to executing.")] [SerializeField] protected string luaBindingName = "flowchart"; + protected static List cachedFlowcharts = new List(); + protected static bool eventSystemPresent; protected StringSubstituter stringSubstituer; - /// - /// Cached list of flowchart objects in the scene for fast lookup. - /// - public static List cachedFlowcharts = new List(); - - /// - /// Sends a message to all Flowchart objects in the current scene. - /// Any block with a matching MessageReceived event handler will start executing. - /// - public static void BroadcastFungusMessage(string messageName) - { - MessageReceived[] eventHandlers = UnityEngine.Object.FindObjectsOfType(); - foreach (MessageReceived eventHandler in eventHandlers) - { - eventHandler.OnSendFungusMessage(messageName); - } - } - #if UNITY_5_4_OR_NEWER protected virtual void Awake() { @@ -200,7 +184,7 @@ namespace Fungus // Make sure item ids are unique and monotonically increasing. // This should always be the case, but some legacy Flowcharts may have issues. List usedIds = new List(); - var blocks = GetComponents(); + var blocks = GetComponents(); foreach (var block in blocks) { if (block.ItemId == -1 || @@ -211,7 +195,7 @@ namespace Fungus usedIds.Add(block.ItemId); } - var commands = GetComponents(); + var commands = GetComponents(); foreach (var command in commands) { if (command.ItemId == -1 || @@ -241,7 +225,7 @@ namespace Fungus } } - var blocks = GetComponents(); + var blocks = GetComponents(); foreach (var command in GetComponents()) { @@ -286,66 +270,152 @@ namespace Fungus return block; } - #region IFlowchart implementation + #region Public methods + + /// + /// Cached list of flowchart objects in the scene for fast lookup. + /// + public static List CachedFlowcharts { get { return cachedFlowcharts; } } + + /// + /// Sends a message to all Flowchart objects in the current scene. + /// Any block with a matching MessageReceived event handler will start executing. + /// + public static void BroadcastFungusMessage(string messageName) + { + MessageReceived[] eventHandlers = UnityEngine.Object.FindObjectsOfType(); + foreach (MessageReceived eventHandler in eventHandlers) + { + eventHandler.OnSendFungusMessage(messageName); + } + } + /// + /// Scroll position of Flowchart editor window. + /// public virtual Vector2 ScrollPos { get { return scrollPos; } set { scrollPos = value; } } + /// + /// Scroll position of Flowchart variables window. + /// public virtual Vector2 VariablesScrollPos { get { return variablesScrollPos; } set { variablesScrollPos = value; } } + /// + /// Show the variables pane. + /// public virtual bool VariablesExpanded { get { return variablesExpanded; } set { variablesExpanded = value; } } + /// + /// Height of command block view in inspector. + /// public virtual float BlockViewHeight { get { return blockViewHeight; } set { blockViewHeight = value; } } + /// + /// Zoom level of Flowchart editor window. + /// public virtual float Zoom { get { return zoom; } set { zoom = value; } } + /// + /// Scrollable area for Flowchart editor window. + /// public virtual Rect ScrollViewRect { get { return scrollViewRect; } set { scrollViewRect = value; } } + /// + /// Currently selected block in the Flowchart editor. + /// public virtual Block SelectedBlock { get { return selectedBlock; } set { selectedBlock = value; } } + /// + /// Currently selected command in the Flowchart editor. + /// public virtual List SelectedCommands { get { return selectedCommands; } } + /// + /// The list of variables that can be accessed by the Flowchart. + /// public virtual List Variables { get { return variables; } } + /// + /// Description text displayed in the Flowchart editor window + /// public virtual string Description { get { return description; } } + /// + /// Slow down execution in the editor to make it easier to visualise program flow. + /// public virtual float StepPause { get { return stepPause; } } + /// + /// Use command color when displaying the command list in the inspector. + /// public virtual bool ColorCommands { get { return colorCommands; } } + /// + /// Saves the selected block and commands when saving the scene. Helps avoid version control conflicts if you've only changed the active selection. + /// public virtual bool SaveSelection { get { return saveSelection; } } + /// + /// Unique identifier for identifying this flowchart in localized string keys. + /// public virtual string LocalizationId { get { return localizationId; } } + /// + /// Display line numbers in the command list in the Block inspector. + /// public virtual bool ShowLineNumbers { get { return showLineNumbers; } } + /// + /// Lua Environment to be used by default for all Execute Lua commands in this Flowchart. + /// public virtual ILuaEnvironment LuaEnv { get { return luaEnvironment; } } + /// + /// The ExecuteLua command adds a global Lua variable with this name bound to the flowchart prior to executing. + /// public virtual string LuaBindingName { get { return luaBindingName; } } + /// + /// Position in the center of all blocks in the flowchart. + /// public virtual Vector2 CenterPosition { set; get; } + /// + /// Variable to track flowchart's version so components can update to new versions. + /// public int Version { set { version = value; } } + /// + /// Returns true if the Flowchart gameobject is active. + /// public bool IsActive() { return gameObject.activeInHierarchy; } + /// + /// Returns the Flowchart gameobject name. + /// public string GetName() { return gameObject.name; } + /// + /// Returns the next id to assign to a new flowchart item. + /// Item ids increase monotically so they are guaranteed to + /// be unique within a Flowchart. + /// public int NextItemId() { int maxId = -1; - var blocks = GetComponents(); + var blocks = GetComponents(); foreach (var block in blocks) { maxId = Math.Max(maxId, block.ItemId); } - var commands = GetComponents(); + var commands = GetComponents(); foreach (var command in commands) { maxId = Math.Max(maxId, command.ItemId); @@ -353,6 +423,9 @@ namespace Fungus return maxId + 1; } + /// + /// Create a new block node which you can then add commands to. + /// public virtual Block CreateBlock(Vector2 position) { Block b = CreateBlockComponent(gameObject); @@ -363,9 +436,12 @@ namespace Fungus return b; } - public virtual IBlock FindBlock(string blockName) + /// + /// Returns the named Block in the flowchart, or null if not found. + /// + public virtual Block FindBlock(string blockName) { - var blocks = GetComponents(); + var blocks = GetComponents(); foreach (var block in blocks) { if (block.BlockName == blockName) @@ -377,6 +453,9 @@ namespace Fungus return null; } + /// + /// Execute a child block in the Flowchart. + /// You can use this method in a UI event. e.g. to handle a button click. public virtual void ExecuteBlock(string blockName) { var block = FindBlock(blockName); @@ -393,7 +472,13 @@ namespace Fungus } } - public virtual bool ExecuteBlock(IBlock block, int commandIndex = 0, Action onComplete = null) + /// + /// Execute a child block in the flowchart. + /// The block must be in an idle state to be executed. + /// This version provides extra options to control how the block is executed. + /// Returns true if the Block started execution. + /// + public virtual bool ExecuteBlock(Block block, int commandIndex = 0, Action onComplete = null) { if (block == null) { @@ -419,10 +504,13 @@ namespace Fungus return true; } + /// + /// Stop all executing Blocks in this Flowchart. + /// public virtual void StopAllBlocks() { - var blocks = GetComponents(); - foreach (IBlock block in blocks) + var blocks = GetComponents(); + foreach (Block block in blocks) { if (block.IsExecuting()) { @@ -431,6 +519,10 @@ namespace Fungus } } + /// + /// Sends a message to this Flowchart only. + /// Any block with a matching MessageReceived event handler will start executing. + /// public virtual void SendFungusMessage(string messageName) { MessageReceived[] eventHandlers = GetComponents(); @@ -440,6 +532,9 @@ namespace Fungus } } + /// + /// Returns a new variable key that is guaranteed not to clash with any existing variable in the list. + /// public virtual string GetUniqueVariableKey(string originalKey, Variable ignoreVariable = null) { int suffix = 0; @@ -486,7 +581,10 @@ namespace Fungus } } - public virtual string GetUniqueBlockKey(string originalKey, IBlock ignoreBlock = null) + /// + /// Returns a new Block key that is guaranteed not to clash with any existing Block in the Flowchart. + /// + public virtual string GetUniqueBlockKey(string originalKey, Block ignoreBlock = null) { int suffix = 0; string baseKey = originalKey.Trim(); @@ -497,7 +595,7 @@ namespace Fungus baseKey = FungusConstants.DefaultBlockName; } - var blocks = GetComponents(); + var blocks = GetComponents(); string key = baseKey; while (true) @@ -526,6 +624,9 @@ namespace Fungus } } + /// + /// Returns a new Label key that is guaranteed not to clash with any existing Label in the Block. + /// public virtual string GetUniqueLabelKey(string originalKey, Label ignoreLabel) { int suffix = 0; @@ -537,7 +638,7 @@ namespace Fungus baseKey = "New Label"; } - IBlock block = ignoreLabel.ParentBlock; + var block = ignoreLabel.ParentBlock; string key = baseKey; while (true) @@ -567,6 +668,13 @@ namespace Fungus } } + /// + /// Returns the variable with the specified key, or null if the key is not found. + /// You will need to cast the returned variable to the correct sub-type. + /// You can then access the variable's value using the Value property. e.g. + /// BooleanVariable boolVar = flowchart.GetVariable("MyBool") as BooleanVariable; + /// boolVar.Value = false; + /// public Variable GetVariable(string key) { foreach (Variable variable in variables) @@ -580,6 +688,12 @@ namespace Fungus return null; } + /// + /// Returns the variable with the specified key, or null if the key is not found. + /// You can then access the variable's value using the Value property. e.g. + /// BooleanVariable boolVar = flowchart.GetVariable("MyBool"); + /// boolVar.Value = false; + /// public T GetVariable(string key) where T : Variable { foreach (Variable variable in variables) @@ -594,6 +708,10 @@ namespace Fungus return null; } + /// + /// Register a new variable with the Flowchart at runtime. + /// The variable should be added as a component on the Flowchart game object. + /// public void SetVariable(string key, T newvariable) where T : Variable { foreach (Variable v in variables) @@ -612,6 +730,9 @@ namespace Fungus Debug.LogWarning("Variable " + key + " not found."); } + /// + /// Gets a list of all variables with public scope in this Flowchart. + /// public virtual List GetPublicVariables() { List publicVariables = new List(); @@ -626,6 +747,10 @@ namespace Fungus return publicVariables; } + /// + /// Gets the value of a boolean variable. + /// Returns false if the variable key does not exist. + /// public virtual bool GetBooleanVariable(string key) { BooleanVariable variable = GetVariable(key); @@ -640,6 +765,10 @@ namespace Fungus } } + /// + /// Sets the value of a boolean variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// public virtual void SetBooleanVariable(string key, bool value) { BooleanVariable variable = GetVariable(key); @@ -649,6 +778,10 @@ namespace Fungus } } + /// + /// Gets the value of an integer variable. + /// Returns 0 if the variable key does not exist. + /// public virtual int GetIntegerVariable(string key) { IntegerVariable variable = GetVariable(key); @@ -663,6 +796,10 @@ namespace Fungus } } + /// + /// Sets the value of an integer variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// public virtual void SetIntegerVariable(string key, int value) { IntegerVariable variable = GetVariable(key); @@ -672,6 +809,10 @@ namespace Fungus } } + /// + /// Gets the value of a float variable. + /// Returns 0 if the variable key does not exist. + /// public virtual float GetFloatVariable(string key) { FloatVariable variable = GetVariable(key); @@ -686,6 +827,10 @@ namespace Fungus } } + /// + /// Sets the value of a float variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// public virtual void SetFloatVariable(string key, float value) { FloatVariable variable = GetVariable(key); @@ -695,6 +840,10 @@ namespace Fungus } } + /// + /// Gets the value of a string variable. + /// Returns the empty string if the variable key does not exist. + /// public virtual string GetStringVariable(string key) { StringVariable variable = GetVariable(key); @@ -709,6 +858,10 @@ namespace Fungus } } + /// + /// Sets the value of a string variable. + /// The variable must already be added to the list of variables for this Flowchart. + /// public virtual void SetStringVariable(string key, string value) { StringVariable variable = GetVariable(key); @@ -718,6 +871,9 @@ namespace Fungus } } + /// + /// Set the block objects to be hidden or visible depending on the hideComponents property. + /// public virtual void UpdateHideFlags() { if (hideComponents) @@ -758,14 +914,19 @@ namespace Fungus monoBehaviour.gameObject.hideFlags = HideFlags.None; } } - } + /// + /// Clears the list of selected commands. + /// public virtual void ClearSelectedCommands() { selectedCommands.Clear(); } + /// + /// Adds a command to the list of selected commands. + /// public virtual void AddSelectedCommand(Command command) { if (!selectedCommands.Contains(command)) @@ -774,11 +935,14 @@ namespace Fungus } } + /// + /// Reset the commands and variables in the Flowchart. + /// public virtual void Reset(bool resetCommands, bool resetVariables) { if (resetCommands) { - ICommand[] commands = GetComponents(); + var commands = GetComponents(); foreach (var command in commands) { command.OnReset(); @@ -794,6 +958,9 @@ namespace Fungus } } + /// + /// Override this in a Flowchart subclass to filter which commands are shown in the Add Command list. + /// public virtual bool IsCommandSupported(CommandInfoAttribute commandInfo) { foreach (string key in hideCommands) @@ -809,10 +976,13 @@ namespace Fungus return true; } + /// + /// Returns true if there are any executing blocks in this Flowchart. + /// public virtual bool HasExecutingBlocks() { - var blocks = GetComponents(); - foreach (IBlock block in blocks) + var blocks = GetComponents(); + foreach (var block in blocks) { if (block.IsExecuting()) { @@ -822,10 +992,13 @@ namespace Fungus return false; } - public virtual List GetExecutingBlocks() + /// + /// Returns a list of all executing blocks in this Flowchart. + /// + public virtual List GetExecutingBlocks() { - var executingBlocks = new List(); - var blocks = GetComponents(); + var executingBlocks = new List(); + var blocks = GetComponents(); foreach (var block in blocks) { if (block.IsExecuting()) @@ -837,6 +1010,12 @@ namespace Fungus return executingBlocks; } + /// + /// Substitute variables in the input text with the format {$VarName} + /// This will first match with private variables in this Flowchart, and then + /// with public variables in all Flowcharts in the scene (and any component + /// in the scene that implements StringSubstituter.ISubstitutionHandler). + /// public virtual string SubstituteVariables(string input) { if (stringSubstituer == null) diff --git a/Assets/Fungus/Scripts/Components/FungusState.cs b/Assets/Fungus/Scripts/Components/FungusState.cs index af544577..71aabd6e 100644 --- a/Assets/Fungus/Scripts/Components/FungusState.cs +++ b/Assets/Fungus/Scripts/Components/FungusState.cs @@ -10,12 +10,15 @@ namespace Fungus /// so that the same Flowchart can be displayed while editing & playing. /// [AddComponentMenu("")] - public class FungusState : MonoBehaviour, IFungusState + public class FungusState : MonoBehaviour { [SerializeField] protected Flowchart selectedFlowchart; - #region IFungusState implementation + #region Public methods + /// + /// The currently selected Flowchart. + /// public virtual Flowchart SelectedFlowchart { get { return selectedFlowchart; } set { selectedFlowchart = value; } } #endregion diff --git a/Assets/Fungus/Scripts/Components/Localization.cs b/Assets/Fungus/Scripts/Components/Localization.cs index 5cd3216a..f5095faa 100644 --- a/Assets/Fungus/Scripts/Components/Localization.cs +++ b/Assets/Fungus/Scripts/Components/Localization.cs @@ -16,7 +16,7 @@ namespace Fungus /// /// Multi-language localization support. /// - public class Localization : MonoBehaviour, ILocalization, ISubstitutionHandler + public class Localization : MonoBehaviour, ISubstitutionHandler { /// /// Temp storage for a single item of standard text and its localizations. @@ -93,26 +93,6 @@ namespace Fungus initialized = true; } - /// - /// Looks up the specified string in the localized strings table. - /// For this to work, a localization file and active language must have been set previously. - /// Return null if the string is not found. - /// - public static string GetLocalizedString(string stringId) - { - if (localizedStrings == null) - { - return null; - } - - if (localizedStrings.ContainsKey(stringId)) - { - return localizedStrings[stringId]; - } - - return null; - } - // Build a cache of all the localizeable objects in the scene protected virtual void CacheLocalizeableObjects() { @@ -139,7 +119,7 @@ namespace Fungus var flowcharts = GameObject.FindObjectsOfType(); foreach (var flowchart in flowcharts) { - var blocks = flowchart.GetComponents(); + var blocks = flowchart.GetComponents(); foreach (var block in blocks) { foreach (var command in block.CommandList) @@ -247,19 +227,54 @@ namespace Fungus } } - #region ILocalization interface + #region Public methods + + /// + /// Looks up the specified string in the localized strings table. + /// For this to work, a localization file and active language must have been set previously. + /// Return null if the string is not found. + /// + public static string GetLocalizedString(string stringId) + { + if (localizedStrings == null) + { + return null; + } + + if (localizedStrings.ContainsKey(stringId)) + { + return localizedStrings[stringId]; + } + return null; + } + + /// + /// Language to use at startup, usually defined by a two letter language code (e.g DE = German). + /// public virtual string ActiveLanguage { get { return activeLanguage; } } + /// + /// CSV file containing localization data which can be easily edited in a spreadsheet tool. + /// public virtual TextAsset LocalizationFile { get { return localizationFile; } set { localizationFile = value; } } + /// + /// Stores any notification message from export / import methods. + /// public virtual string NotificationText { get { return notificationText; } set { notificationText = value; } } + /// + /// Clears the cache of localizeable objects. + /// public virtual void ClearLocalizeableCache() { localizeableObjects.Clear(); } + /// + /// Convert all text items and localized strings to an easy to edit CSV format. + /// public virtual string GetCSVData() { // Collect all the text items present in the scene @@ -319,6 +334,10 @@ namespace Fungus return csvData; } + /// + /// Scan a localization CSV file and copies the strings for the specified language code + /// into the text properties of the appropriate scene objects. + /// public virtual void SetActiveLanguage(string languageCode, bool forceUpdateSceneText = false) { if (!Application.isPlaying) @@ -411,6 +430,9 @@ namespace Fungus } } + /// + /// Populates the text property of a single scene object with a new text value. + /// public virtual bool PopulateTextProperty(string stringId, string newText) { // Ensure that all localizeable objects have been cached @@ -430,6 +452,10 @@ namespace Fungus return false; } + /// + /// Returns all standard text for localizeable text in the scene using an + /// easy to edit custom text format. + /// public virtual string GetStandardText() { // Collect all the text items present in the scene @@ -451,6 +477,9 @@ namespace Fungus return textData; } + /// + /// Sets standard text on scene objects by parsing a text data file. + /// public virtual void SetStandardText(string textData) { string[] lines = textData.Split('\n'); diff --git a/Assets/Fungus/Scripts/Components/MenuDialog.cs b/Assets/Fungus/Scripts/Components/MenuDialog.cs index 3a081fd0..6637b093 100644 --- a/Assets/Fungus/Scripts/Components/MenuDialog.cs +++ b/Assets/Fungus/Scripts/Components/MenuDialog.cs @@ -10,7 +10,10 @@ using MoonSharp.Interpreter; namespace Fungus { - public class MenuDialog : MonoBehaviour, IMenuDialog + /// + /// Presents multiple choice buttons to the players. + /// + public class MenuDialog : MonoBehaviour { [Tooltip("Automatically select the first interactable button when the menu is shown.")] [SerializeField] protected bool autoSelectFirstButton = false; @@ -19,37 +22,6 @@ namespace Fungus protected Slider cachedSlider; - // Currently active Menu Dialog used to display Menu options - public static IMenuDialog activeMenuDialog; - - public static IMenuDialog GetMenuDialog() - { - if (activeMenuDialog == null) - { - // Use first Menu Dialog found in the scene (if any) - IMenuDialog md = GameObject.FindObjectOfType(); - if (md != null) - { - activeMenuDialog = md; - } - - if (activeMenuDialog == null) - { - // Auto spawn a menu dialog object from the prefab - GameObject prefab = Resources.Load("Prefabs/MenuDialog"); - if (prefab != null) - { - GameObject go = Instantiate(prefab) as GameObject; - go.SetActive(false); - go.name = "MenuDialog"; - activeMenuDialog = go.GetComponent(); - } - } - } - - return activeMenuDialog; - } - protected virtual void Awake() { Button[] optionButtons = GetComponentsInChildren [ExecuteInEditMode] - public class Stage : PortraitController, IStage + public class Stage : PortraitController { [Tooltip("Canvas object containing the stage positions.")] [SerializeField] protected Canvas portraitCanvas; @@ -65,6 +65,11 @@ namespace Fungus } } + #region Public methods + + /// + /// Returns the currently active stage. + /// public static Stage GetActiveStage() { if (Stage.activeStages == null || @@ -76,26 +81,55 @@ namespace Fungus return Stage.activeStages[0]; } - #region IStage implementation - + /// + /// Canvas object containing the stage positions. + /// public virtual Canvas PortraitCanvas { get { return portraitCanvas; } } + /// + /// Dim portraits when a character is not speaking. + /// public virtual bool DimPortraits { get { return dimPortraits; } set { dimPortraits = value; } } + /// + /// Duration for fading character portraits in / out. + /// public virtual float FadeDuration { get { return fadeDuration; } set { fadeDuration = value; } } + /// + /// Duration for moving characters to a new position. + /// public virtual float MoveDuration { get { return moveDuration; } set { moveDuration = value; } } + /// + /// Ease type for the fade tween. + /// public virtual LeanTweenType FadeEaseType { get { return fadeEaseType; } } + /// + /// Constant offset to apply to portrait position. + /// public virtual Vector2 ShiftOffset { get { return shiftOffset; } } + /// + /// The position object where characters appear by default. + /// public virtual Image DefaultPosition { get { return defaultPosition; } } + /// + /// List of stage position rect transforms in the stage. + /// public virtual List Positions { get { return positions; } } + /// + /// List of currently active characters on the stage. + /// public virtual List CharactersOnStage { get { return charactersOnStage; } } + /// + /// Searches the stage's named positions + /// If none matches the string provided, give a warning and return a new RectTransform + /// public RectTransform GetPosition(string positionString) { if (string.IsNullOrEmpty(positionString)) diff --git a/Assets/Fungus/Scripts/Components/Variable.cs b/Assets/Fungus/Scripts/Components/Variable.cs index 6f8969d1..9c4cb9e3 100644 --- a/Assets/Fungus/Scripts/Components/Variable.cs +++ b/Assets/Fungus/Scripts/Components/Variable.cs @@ -6,6 +6,36 @@ using System; namespace Fungus { + /// + /// Standard comparison operators. + /// + public enum CompareOperator + { + /// == mathematical operator. + Equals, + /// != mathematical operator. + NotEquals, + /// < mathematical operator. + LessThan, + /// > mathematical operator. + GreaterThan, + /// <= mathematical operator. + LessThanOrEquals, + /// >= mathematical operator. + GreaterThanOrEquals + } + + /// + /// Scope types for Variables. + /// + public enum VariableScope + { + /// Can only be accessed by commands in the same Flowchart. + Private, + /// Can be accessed from any command in any Flowchart. + Public + } + /// /// Attribute class for variables. /// @@ -48,18 +78,27 @@ namespace Fungus /// Abstract base class for variables. /// [RequireComponent(typeof(Flowchart))] - public abstract class Variable : MonoBehaviour, IVariable + public abstract class Variable : MonoBehaviour { [SerializeField] protected VariableScope scope; [SerializeField] protected string key = ""; - #region IVariable implementation + #region Public methods + /// + /// Visibility scope for the variable. + /// public virtual VariableScope Scope { get { return scope; } } + /// + /// String identifier for the variable. + /// public virtual string Key { get { return key; } set { key = value; } } + /// + /// Callback to reset the variable if the Flowchart is reset. + /// public abstract void OnReset(); #endregion diff --git a/Assets/Fungus/Scripts/Components/View.cs b/Assets/Fungus/Scripts/Components/View.cs index bebefd5a..2faa309b 100644 --- a/Assets/Fungus/Scripts/Components/View.cs +++ b/Assets/Fungus/Scripts/Components/View.cs @@ -10,7 +10,7 @@ namespace Fungus /// The position and rotation are specified using the game object's transform, so this class only needs to specify the ortographic view size. /// [ExecuteInEditMode] - public class View : MonoBehaviour, IView + public class View : MonoBehaviour { [Tooltip("Orthographic size of the camera view in world units.")] [SerializeField] protected float viewSize = 0.5f; @@ -27,12 +27,21 @@ namespace Fungus transform.localScale = new Vector3(1,1,1); } - #region IView implementation + #region Public methods + /// + /// Orthographic size of the camera view in world units. + /// public virtual float ViewSize { get { return viewSize; } set { viewSize = value; } } + /// + /// Aspect ratio of the primary view rectangle. e.g. a 4:3 aspect ratio = 1.333. + /// public virtual Vector2 PrimaryAspectRatio { get { return primaryAspectRatio; } set { primaryAspectRatio = value; } } + /// + /// Aspect ratio of the secondary view rectangle. e.g. a 2:1 aspect ratio = 2/1 = 2.0. + /// public virtual Vector2 SecondaryAspectRatio { get { return secondaryAspectRatio; } set { secondaryAspectRatio = value; } } #endregion diff --git a/Assets/Fungus/Scripts/Components/Writer.cs b/Assets/Fungus/Scripts/Components/Writer.cs index 836526f4..a23d8b13 100644 --- a/Assets/Fungus/Scripts/Components/Writer.cs +++ b/Assets/Fungus/Scripts/Components/Writer.cs @@ -15,7 +15,7 @@ namespace Fungus /// /// Writes text using a typewriter effect to a UI text object. /// - public class Writer : MonoBehaviour, IWriter, IDialogInputListener + public class Writer : MonoBehaviour, IDialogInputListener { [Tooltip("Gameobject containing a Text, Inout Field or Text Mesh object to write to")] [SerializeField] protected GameObject targetTextObject; @@ -75,51 +75,6 @@ namespace Fungus protected string hiddenColorOpen = ""; protected string hiddenColorClose = ""; - public virtual string text - { - get - { - if (textUI != null) - { - return textUI.text; - } - else if (inputField != null) - { - return inputField.text; - } - else if (textMesh != null) - { - return textMesh.text; - } - else if (textProperty != null) - { - return textProperty.GetValue(textComponent, null) as string; - } - - return ""; - } - - set - { - if (textUI != null) - { - textUI.text = value; - } - else if (inputField != null) - { - inputField.text = value; - } - else if (textMesh != null) - { - textMesh.text = value; - } - else if (textProperty != null) - { - textProperty.SetValue(textComponent, value, null); - } - } - } - protected virtual void Awake() { GameObject go = targetTextObject; @@ -180,28 +135,6 @@ namespace Fungus } } - public virtual bool HasTextObject() - { - return (textUI != null || inputField != null || textMesh != null || textComponent != null); - } - - public virtual bool SupportsRichText() - { - if (textUI != null) - { - return textUI.supportRichText; - } - if (inputField != null) - { - return false; - } - if (textMesh != null) - { - return textMesh.richText; - } - return false; - } - protected virtual void UpdateOpenMarkup() { openString.Length = 0; @@ -256,7 +189,7 @@ namespace Fungus } } - virtual protected bool CheckParamCount(List paramList, int count) + protected virtual bool CheckParamCount(List paramList, int count) { if (paramList == null) { @@ -368,7 +301,7 @@ namespace Fungus break; case TokenType.Clear: - text = ""; + Text = ""; break; case TokenType.SpeedStart: @@ -522,7 +455,7 @@ namespace Fungus param = param.TrimStart(' ', '\t', '\r', '\n'); } - string startText = text; + string startText = Text; UpdateOpenMarkup(); UpdateCloseMarkup(); @@ -538,7 +471,7 @@ namespace Fungus PartitionString(writeWholeWords, param, i); ConcatenateString(startText); - text = outputString.ToString(); + Text = outputString.ToString(); NotifyGlyph(); @@ -571,7 +504,7 @@ namespace Fungus } } - protected void PartitionString(bool wholeWords, string inputString, int i) + protected virtual void PartitionString(bool wholeWords, string inputString, int i) { leftString.Length = 0; rightString.Length = 0; @@ -605,7 +538,7 @@ namespace Fungus } } - protected void ConcatenateString(string startText) + protected virtual void ConcatenateString(string startText) { outputString.Length = 0; @@ -625,11 +558,6 @@ namespace Fungus } } - public virtual string GetTagHelp() - { - return ""; - } - protected virtual IEnumerator DoWait(List paramList) { var param = ""; @@ -716,7 +644,7 @@ namespace Fungus protected virtual void Flash(float duration) { - ICameraController cameraController = CameraController.GetInstance(); + var cameraController = CameraController.GetInstance(); cameraController.ScreenFadeTexture = CameraController.CreateColorTexture(new Color(1f,1f,1f,1f), 32, 32); cameraController.Fade(1f, duration, delegate { cameraController.ScreenFadeTexture = CameraController.CreateColorTexture(new Color(1f,1f,1f,1f), 32, 32); @@ -743,7 +671,6 @@ namespace Fungus } } - protected virtual void NotifyStart(AudioClip audioClip) { foreach (IWriterListener writerListener in writerListeners) @@ -784,26 +711,69 @@ namespace Fungus } } - #region IDialogInputListener implementation + #region Public methods - public virtual void OnNextLineEvent() + /// + /// Gets or sets the text property of the attached text object. + /// + public virtual string Text { - inputFlag = true; + get + { + if (textUI != null) + { + return textUI.text; + } + else if (inputField != null) + { + return inputField.text; + } + else if (textMesh != null) + { + return textMesh.text; + } + else if (textProperty != null) + { + return textProperty.GetValue(textComponent, null) as string; + } - if (isWriting) + return ""; + } + + set { - NotifyInput(); + if (textUI != null) + { + textUI.text = value; + } + else if (inputField != null) + { + inputField.text = value; + } + else if (textMesh != null) + { + textMesh.text = value; + } + else if (textProperty != null) + { + textProperty.SetValue(textComponent, value, null); + } } } - #endregion - - #region IWriter implementation - + /// + /// This property is true when the writer is writing text or waiting (i.e. still processing tokens). + /// public virtual bool IsWriting { get { return isWriting; } } + /// + /// This property is true when the writer is waiting for user input to continue. + /// public virtual bool IsWaitingForInput { get { return isWaitingForInput; } } + /// + /// Stop writing text. + /// public virtual void Stop() { if (isWriting || isWaitingForInput) @@ -812,11 +782,20 @@ namespace Fungus } } + /// + /// Writes text using a typewriter effect to a UI text object. + /// + /// Text to be written + /// If true clears the previous text. + /// Writes the text and then waits for player input before calling onComplete. + /// Stops any currently playing audioclip. + /// Audio clip to play when text starts writing. + /// Callback to call when writing is finished. public virtual IEnumerator Write(string content, bool clear, bool waitForInput, bool stopAudio, AudioClip audioClip, Action onComplete) { if (clear) { - this.text = ""; + this.Text = ""; } if (!HasTextObject()) @@ -833,14 +812,16 @@ namespace Fungus tokenText += "{wi}"; } - ITextTagParser tagParser = new TextTagParser(); - List tokens = tagParser.Tokenize(tokenText); + List tokens = TextTagParser.Tokenize(tokenText); gameObject.SetActive(true); yield return StartCoroutine(ProcessTokens(tokens, stopAudio, onComplete)); } + /// + /// Sets the color property of the text UI object. + /// public virtual void SetTextColor(Color textColor) { if (textUI != null) @@ -860,6 +841,9 @@ namespace Fungus } } + /// + /// Sets the alpha component of the color property of the text UI object. + /// public virtual void SetTextAlpha(float textAlpha) { if (textUI != null) @@ -885,6 +869,48 @@ namespace Fungus } } + /// + /// Returns true if there is a supported text object attached to this writer. + /// + public virtual bool HasTextObject() + { + return (textUI != null || inputField != null || textMesh != null || textComponent != null); + } + + /// + /// Returns true if the text object has rich text support. + /// + public virtual bool SupportsRichText() + { + if (textUI != null) + { + return textUI.supportRichText; + } + if (inputField != null) + { + return false; + } + if (textMesh != null) + { + return textMesh.richText; + } + return false; + } + + #endregion + + #region IDialogInputListener implementation + + public virtual void OnNextLineEvent() + { + inputFlag = true; + + if (isWriting) + { + NotifyInput(); + } + } + #endregion } } diff --git a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs index d5b68722..1f9bed6e 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs @@ -551,7 +551,7 @@ namespace Fungus.EditorUtils return newBlock; } - protected virtual void DeleteBlock(Flowchart flowchart, IBlock block) + protected virtual void DeleteBlock(Flowchart flowchart, Block block) { foreach (var command in block.CommandList) { diff --git a/Assets/Fungus/Scripts/Interfaces/IBlock.cs b/Assets/Fungus/Scripts/Interfaces/IBlock.cs deleted file mode 100644 index b38321a1..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IBlock.cs +++ /dev/null @@ -1,119 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using System.Collections; -using System.Collections.Generic; - -namespace Fungus -{ - /// - /// Execution state of a Block. - /// - public enum ExecutionState - { - /// No command executing - Idle, - /// Executing a command - Executing, - } - - /// - /// A container for a sequence of Fungus comands. - /// - public interface IBlock - { - /// - /// The execution state of the Block. - /// - ExecutionState State { get; } - - /// - /// Unique identifier for the Block. - /// - int ItemId { get; set; } - - /// - /// The name of the block node as displayed in the Flowchart window. - /// - string BlockName { get; set; } - - /// - /// Description text to display under the block node - /// - string Description { get; } - - /// - /// An optional Event Handler which can execute the block when an event occurs. - /// Note: Using the concrete class instead of the interface here because of weird editor behaviour. - /// - EventHandler _EventHandler { get; set; } - - /// - /// The currently executing command. - /// - Command ActiveCommand { get; } - - /// - /// Timer for fading Block execution icon. - /// - float ExecutingIconTimer { get; set; } - - /// - /// The list of commands in the sequence. - /// - List CommandList { get; } - - /// - /// Controls the next command to execute in the block execution coroutine. - /// - int JumpToCommandIndex { set; } - - /// - /// Returns the parent Flowchart for this Block. - /// - IFlowchart GetFlowchart(); - - /// - /// Returns true if the Block is executing a command. - /// - bool IsExecuting(); - - /// - /// Returns the number of times this Block has executed. - /// - int GetExecutionCount(); - - /// - /// Start a coroutine which executes all commands in the Block. Only one running instance of each Block is permitted. - /// - void StartExecution(); - - /// - /// A coroutine method that executes all commands in the Block. Only one running instance of each Block is permitted. - /// - /// Index of command to start execution at - /// Delegate function to call when execution completes - IEnumerator Execute(int commandIndex = 0, System.Action onComplete = null); - - /// - /// Stop executing commands in this Block. - /// - void Stop(); - - /// - /// Returns a list of all Blocks connected to this one. - /// - List GetConnectedBlocks(); - - /// - /// Returns the type of the previously executing command. - /// - /// The previous active command type. - System.Type GetPreviousActiveCommandType(); - - /// - /// Recalculate the indent levels for all commands in the list. - /// - void UpdateIndentLevels(); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IBlock.cs.meta b/Assets/Fungus/Scripts/Interfaces/IBlock.cs.meta deleted file mode 100644 index a0965ceb..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IBlock.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3a23dd66c807e4fab86a64184c3faa9a -timeCreated: 1473856388 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/ICameraController.cs b/Assets/Fungus/Scripts/Interfaces/ICameraController.cs deleted file mode 100644 index 977d20da..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ICameraController.cs +++ /dev/null @@ -1,49 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; - -namespace Fungus -{ - /// - /// Controller for main camera.Supports several types of camera transition including snap, pan & fade. - /// - public interface ICameraController - { - /// - /// Full screen texture used for screen fade effect. - /// - /// The screen fade texture. - Texture2D ScreenFadeTexture { set; } - - /// - /// Perform a fullscreen fade over a duration. - /// - void Fade(float targetAlpha, float fadeDuration, System.Action fadeAction); - - /// - /// Fade out, move camera to view and then fade back in. - /// - void FadeToView(Camera camera, View view, float fadeDuration, bool fadeOut, System.Action fadeAction); - - /// - /// Stop all camera tweening. - /// - void Stop(); - - /// - /// Moves camera from current position to a target position over a period of time. - /// - void PanToPosition(Camera camera, Vector3 targetPosition, Quaternion targetRotation, float targetSize, float duration, System.Action arriveAction); - - /// - /// Activates swipe panning mode. The player can pan the camera within the area between viewA & viewB. - /// - void StartSwipePan(Camera camera, View viewA, View viewB, float duration, float speedMultiplier, System.Action arriveAction); - - /// - /// Deactivates swipe panning mode. - /// - void StopSwipePan(); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/ICameraController.cs.meta b/Assets/Fungus/Scripts/Interfaces/ICameraController.cs.meta deleted file mode 100644 index 43f258f6..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ICameraController.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 182888cc7e1a0470c81e9ea6966d6fc6 -timeCreated: 1473431064 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/ICharacter.cs b/Assets/Fungus/Scripts/Interfaces/ICharacter.cs deleted file mode 100644 index 4312ac0c..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ICharacter.cs +++ /dev/null @@ -1,74 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; -using System.Collections.Generic; -using Fungus.Utils; - -namespace Fungus -{ - /// - /// A Character that can be used in dialogue via the Say, Conversation and Portrait commands. - /// - public interface ICharacter - { - /// - /// Character name as displayed in Say Dialog. - /// - string NameText { get; } - - /// - /// Color to display the character name in Say Dialog. - /// - Color NameColor { get; } - - /// - /// Sound effect to play when this character is speaking. - /// - /// The sound effect. - AudioClip SoundEffect { get; } - - /// - /// List of portrait images that can be displayed for this character. - /// - List Portraits { get; } - - /// - /// Direction that portrait sprites face. - /// - FacingDirection PortraitsFace { get; } - - /// - /// Currently display profile sprite for this character. - /// - /// The profile sprite. - Sprite ProfileSprite { get; set; } - - /// - /// Current display state of this character's portrait. - /// - /// The state. - PortraitState State { get; } - - /// - /// Sets the active Say dialog with a reference to a Say Dialog object in the scene. This Say Dialog will be used whenever the character speaks. - /// - ISayDialog SetSayDialog { get; } - - /// - /// Returns the name of the game object. - /// - string GetObjectName(); - - /// - /// Returns true if the character name starts with the specified string. Case insensitive. - /// - bool NameStartsWith(string matchString); - - /// - /// Looks for a portrait by name on a character - /// If none is found, give a warning and return a blank sprite - /// - Sprite GetPortrait(string portraitString); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/ICharacter.cs.meta b/Assets/Fungus/Scripts/Interfaces/ICharacter.cs.meta deleted file mode 100644 index 5fdff1de..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ICharacter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 07a9457a850c147049f1fb7ea4b860cf -timeCreated: 1473676955 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IClickable2D.cs b/Assets/Fungus/Scripts/Interfaces/IClickable2D.cs deleted file mode 100644 index d43d67c1..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IClickable2D.cs +++ /dev/null @@ -1,18 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -namespace Fungus -{ - /// - /// Detects mouse clicks and touches on a Game Object, and sends an event to all Flowchart event handlers in the scene. - /// The Game Object must have a Collider or Collider2D component attached. - /// Use in conjunction with the ObjectClicked Flowchart event handler. - /// - public interface IClickable2D - { - /// - /// Is object clicking enabled. - /// - bool ClickEnabled { set; } - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IClickable2D.cs.meta b/Assets/Fungus/Scripts/Interfaces/IClickable2D.cs.meta deleted file mode 100644 index b67ab2e2..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IClickable2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 477f75d30919449dfa922f74038ceaa4 -timeCreated: 1473690975 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/ICommand.cs b/Assets/Fungus/Scripts/Interfaces/ICommand.cs deleted file mode 100644 index 796450b2..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ICommand.cs +++ /dev/null @@ -1,166 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; -using System.Collections.Generic; - -namespace Fungus -{ - /// - /// Commands can be added to Blocks to create an execution sequence. - /// - public interface ICommand - { - /// - /// Unique identifier for this command. - /// Unique for this Flowchart. - /// - int ItemId { get; set; } - - /// - /// Error message to display in the command inspector. - /// - string ErrorMessage { get; } - - /// - /// Indent depth of the current commands. - /// Commands are indented inside If, While, etc. sections. - /// - int IndentLevel { get; set; } - - /// - /// Index of the command in the parent block's command list. - /// - int CommandIndex { get; set; } - - /// - /// Set to true by the parent block while the command is executing. - /// - bool IsExecuting { get; set; } - - /// - /// Timer used to control appearance of executing icon in inspector. - /// - float ExecutingIconTimer { get; set; } - - /// - /// Reference to the Block object that this command belongs to. - /// This reference is only populated at runtime and in the editor when the - /// block is selected. - /// - Block ParentBlock { get; set; } - - /// - /// Returns the Flowchart that this command belongs to. - /// - IFlowchart GetFlowchart(); - - /// - /// Execute the command. - /// - void Execute(); - - /// - /// End execution of this command and continue execution at the next command. - /// - void Continue(); - - /// - /// End execution of this command and continue execution at a specific command index. - /// - /// Next command index. - void Continue(int nextCommandIndex); - - /// - /// Stops the parent Block executing. - /// - void StopParentBlock(); - - /// - /// Called when the parent block has been requested to stop executing, and - /// this command is the currently executing command. - /// Use this callback to terminate any asynchronous operations and - /// cleanup state so that the command is ready to execute again later on. - /// - void OnStopExecuting(); - - /// - /// Called when the new command is added to a block in the editor. - /// - void OnCommandAdded(Block parentBlock); - - /// - /// Called when the command is deleted from a block in the editor. - /// - void OnCommandRemoved(Block parentBlock); - - /// - /// Called when this command starts execution. - /// - void OnEnter(); - - /// - /// Called when this command ends execution. - /// - void OnExit(); - - /// - /// Called when this command is reset. This happens when the Reset command is used. - /// - void OnReset(); - - /// - /// Populates a list with the Blocks that this command references. - /// - void GetConnectedBlocks(ref List connectedBlocks); - - /// - /// Returns true if this command references the variable. - /// Used to highlight variables in the variable list when a command is selected. - /// - bool HasReference(Variable variable); - - /// - /// Returns the summary text to display in the command inspector. - /// - string GetSummary(); - - /// - /// Returns the help text to display for this command. - /// - string GetHelpText(); - - /// - /// Return true if this command opens a block of commands. Used for indenting commands. - /// - bool OpenBlock(); - - /// - /// Return true if this command closes a block of commands. Used for indenting commands. - /// - bool CloseBlock(); - - /// - /// Return the color for the command background in inspector. - /// - /// The button color. - Color GetButtonColor(); - - /// - /// Returns true if the specified property should be displayed in the inspector. - /// This is useful for hiding certain properties based on the value of another property. - /// - bool IsPropertyVisible(string propertyName); - - /// - /// Returns true if the specified property should be displayed as a reorderable list in the inspector. - /// This only applies for array properties and has no effect for non-array properties. - /// - bool IsReorderableArray(string propertyName); - - /// - /// Returns the localization id for the Flowchart that contains this command. - /// - string GetFlowchartLocalizationId(); - } -} diff --git a/Assets/Fungus/Scripts/Interfaces/ICommand.cs.meta b/Assets/Fungus/Scripts/Interfaces/ICommand.cs.meta deleted file mode 100644 index 6b85918e..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ICommand.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 189c3f33fdd4b47608ac0aa3a2b971bb -timeCreated: 1473856401 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IConversationManager.cs b/Assets/Fungus/Scripts/Interfaces/IConversationManager.cs deleted file mode 100644 index 594748bc..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IConversationManager.cs +++ /dev/null @@ -1,23 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using System.Collections; - -namespace Fungus -{ - /// - /// Helper class to manage parsing and executing the conversation format. - /// - public interface IConversationManager - { - /// - /// Caches the character objects in the scene for fast lookup during conversations. - /// - void PopulateCharacterCache(); - - /// - /// Parse and execute a conversation string. - /// - IEnumerator DoConversation(string conv); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IConversationManager.cs.meta b/Assets/Fungus/Scripts/Interfaces/IConversationManager.cs.meta deleted file mode 100644 index ca2c9951..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IConversationManager.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 3a7ff247990a84e1a96765d1c03735b6 -timeCreated: 1473679803 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/ICustomTag.cs b/Assets/Fungus/Scripts/Interfaces/ICustomTag.cs deleted file mode 100644 index 778791cf..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ICustomTag.cs +++ /dev/null @@ -1,31 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -namespace Fungus -{ - /// - /// Create custom tags for use in Say text. - /// - public interface ICustomTag - { - /// - /// String that defines the start of the tag. - /// - string TagStartSymbol { get; } - - /// - /// String that defines the end of the tag. - /// - string TagEndSymbol { get; } - - /// - /// String to replace the start tag with. - /// - string ReplaceTagStartWith { get; } - - /// - /// String to replace the end tag with. - /// - string ReplaceTagEndWith { get; } - } -} diff --git a/Assets/Fungus/Scripts/Interfaces/ICustomTag.cs.meta b/Assets/Fungus/Scripts/Interfaces/ICustomTag.cs.meta deleted file mode 100644 index b6b9ec49..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ICustomTag.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 59af36c15380c4854860339298d3779e -timeCreated: 1473680400 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IDialogInput.cs b/Assets/Fungus/Scripts/Interfaces/IDialogInput.cs deleted file mode 100644 index aa4d5a85..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IDialogInput.cs +++ /dev/null @@ -1,34 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -namespace Fungus -{ - /// - /// Input handler for say dialogues. - /// - public interface IDialogInput - { - /// - /// Trigger next line input event from script. - /// - void SetNextLineFlag(); - - /// - /// Set the dialog clicked flag (usually from an Event Trigger component in the dialog UI). - /// - void SetDialogClickedFlag(); - - /// - /// Sets the button clicked flag. - /// - void SetButtonClickedFlag(); - } - - /// - /// Interface for listening for dialogue input events. - /// - public interface IDialogInputListener - { - void OnNextLineEvent(); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/ITextTagParser.cs b/Assets/Fungus/Scripts/Interfaces/IDialogInputListener.cs similarity index 61% rename from Assets/Fungus/Scripts/Interfaces/ITextTagParser.cs rename to Assets/Fungus/Scripts/Interfaces/IDialogInputListener.cs index 2c7be361..3693b63d 100644 --- a/Assets/Fungus/Scripts/Interfaces/ITextTagParser.cs +++ b/Assets/Fungus/Scripts/Interfaces/IDialogInputListener.cs @@ -1,13 +1,13 @@ // This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). // It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) -using System.Collections.Generic; -using Fungus.Utils; - namespace Fungus { - public interface ITextTagParser + /// + /// Interface for listening for dialogue input events. + /// + public interface IDialogInputListener { - List Tokenize(string storyText); + void OnNextLineEvent(); } } \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IDialogInput.cs.meta b/Assets/Fungus/Scripts/Interfaces/IDialogInputListener.cs.meta similarity index 100% rename from Assets/Fungus/Scripts/Interfaces/IDialogInput.cs.meta rename to Assets/Fungus/Scripts/Interfaces/IDialogInputListener.cs.meta diff --git a/Assets/Fungus/Scripts/Interfaces/IDraggable2D.cs b/Assets/Fungus/Scripts/Interfaces/IDraggable2D.cs deleted file mode 100644 index 9070cd03..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IDraggable2D.cs +++ /dev/null @@ -1,21 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -namespace Fungus -{ - /// - /// Detects drag and drop interactions on a Game Object, and sends events to all Flowchart event handlers in the scene. - /// The Game Object must have Collider2D & RigidBody components attached. - /// The Collider2D must have the Is Trigger property set to true. - /// The RigidBody would typically have the Is Kinematic property set to true, unless you want the object to move around using physics. - /// Use in conjunction with the Drag Started, Drag Completed, Drag Cancelled, Drag Entered & Drag Exited event handlers. - /// - public interface IDraggable2D - { - /// - /// Is object drag and drop enabled. - /// - /// true if drag enabled; otherwise, false. - bool DragEnabled { get; set; } - } -} diff --git a/Assets/Fungus/Scripts/Interfaces/IDraggable2D.cs.meta b/Assets/Fungus/Scripts/Interfaces/IDraggable2D.cs.meta deleted file mode 100644 index 8b127b00..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IDraggable2D.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: be9f3ca656cc14276b86e6f41cb87d9d -timeCreated: 1473691259 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IEventHandler.cs b/Assets/Fungus/Scripts/Interfaces/IEventHandler.cs deleted file mode 100644 index 4baa1669..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IEventHandler.cs +++ /dev/null @@ -1,31 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -namespace Fungus -{ - /// - /// A Block may have an associated Event Handler which starts executing commands when - /// a specific event occurs. - /// To create a custom Event Handler, simply subclass EventHandler and call the ExecuteBlock() method - /// when the event occurs. - /// Add an EventHandlerInfo attibute and your new EventHandler class will automatically appear in the - /// 'Execute On Event' dropdown menu when a block is selected. - /// - public interface IEventHandler - { - /// - /// The parent Block which owns this Event Handler. - /// - Block ParentBlock { get; set; } - - /// - /// The Event Handler should call this method when the event is detected to start executing the Block. - /// - bool ExecuteBlock(); - - /// - /// Returns custom summary text for the event handler. - /// - string GetSummary(); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IEventHandler.cs.meta b/Assets/Fungus/Scripts/Interfaces/IEventHandler.cs.meta deleted file mode 100644 index 9c74a406..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IEventHandler.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 5ae3dddb3147c4a07a851843721affe8 -timeCreated: 1473856414 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IFlowchart.cs b/Assets/Fungus/Scripts/Interfaces/IFlowchart.cs deleted file mode 100644 index 981141cf..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IFlowchart.cs +++ /dev/null @@ -1,296 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; -using System.Collections.Generic; -using Fungus.Commands; - -namespace Fungus -{ - /// - /// Visual scripting controller for the Flowchart programming language. - /// Flowchart objects may be edited visually using the Flowchart editor window. - /// - public interface IFlowchart - { - /// - /// Scroll position of Flowchart editor window. - /// - Vector2 ScrollPos { get; set; } - - /// - /// Scroll position of Flowchart variables window. - /// - Vector2 VariablesScrollPos { get; set; } - - /// - /// Show the variables pane. - /// - bool VariablesExpanded { get; set; } - - /// - /// Height of command block view in inspector. - /// - float BlockViewHeight { get; set; } - - /// - /// Zoom level of Flowchart editor window. - /// - float Zoom { get; set; } - - /// - /// Scrollable area for Flowchart editor window. - /// - Rect ScrollViewRect { get; set; } - - /// - /// Currently selected block in the Flowchart editor. - /// - Block SelectedBlock { get; set; } - - /// - /// Currently selected command in the Flowchart editor. - /// - List SelectedCommands { get; } - - /// - /// The list of variables that can be accessed by the Flowchart. - /// - List Variables { get; } - - /// - /// Description text displayed in the Flowchart editor window - /// - string Description { get; } - - /// - /// Slow down execution in the editor to make it easier to visualise program flow. - /// - float StepPause { get; } - - /// - /// Use command color when displaying the command list in the inspector. - /// - bool ColorCommands { get; } - - /// - /// Saves the selected block and commands when saving the scene. Helps avoid version control conflicts if you've only changed the active selection. - /// - bool SaveSelection { get; } - - /// - /// Unique identifier for identifying this flowchart in localized string keys. - /// - string LocalizationId { get; } - - /// - /// Display line numbers in the command list in the Block inspector. - /// - bool ShowLineNumbers { get; } - - /// - /// Lua Environment to be used by default for all Execute Lua commands in this Flowchart. - /// - ILuaEnvironment LuaEnv { get; } - - /// - /// The ExecuteLua command adds a global Lua variable with this name bound to the flowchart prior to executing. - /// - string LuaBindingName { get; } - - /// - /// Position in the center of all blocks in the flowchart. - /// - Vector2 CenterPosition { set; get; } - - /// - /// Variable to track flowchart's version so components can update to new versions. - /// - int Version { set; } - - /// - /// Returns the next id to assign to a new flowchart item. - /// Item ids increase monotically so they are guaranteed to - /// be unique within a Flowchart. - /// - int NextItemId(); - - /// - /// Returns true if the Flowchart gameobject is active. - /// - bool IsActive(); - - /// - /// Returns the Flowchart gameobject name. - /// - string GetName(); - - /// - /// Create a new block node which you can then add commands to. - /// - Block CreateBlock(Vector2 position); - - /// - /// Returns the named Block in the flowchart, or null if not found. - /// - IBlock FindBlock(string blockName); - - /// - /// Execute a child block in the Flowchart. - /// You can use this method in a UI event. e.g. to handle a button click. - void ExecuteBlock(string blockName); - - /// - /// Execute a child block in the flowchart. - /// The block must be in an idle state to be executed. - /// This version provides extra options to control how the block is executed. - /// Returns true if the Block started execution. - /// - bool ExecuteBlock(IBlock block, int commandIndex = 0, System.Action onComplete = null); - - /// - /// Stop all executing Blocks in this Flowchart. - /// - void StopAllBlocks(); - - /// - /// Sends a message to this Flowchart only. - /// Any block with a matching MessageReceived event handler will start executing. - /// - void SendFungusMessage(string messageName); - - /// - /// Returns a new variable key that is guaranteed not to clash with any existing variable in the list. - /// - string GetUniqueVariableKey(string originalKey, Variable ignoreVariable = null); - - /// - /// Returns a new Block key that is guaranteed not to clash with any existing Block in the Flowchart. - /// - string GetUniqueBlockKey(string originalKey, IBlock ignoreBlock = null); - - /// - /// Returns a new Label key that is guaranteed not to clash with any existing Label in the Block. - /// - string GetUniqueLabelKey(string originalKey, Label ignoreLabel); - - /// - /// Returns the variable with the specified key, or null if the key is not found. - /// You will need to cast the returned variable to the correct sub-type. - /// You can then access the variable's value using the Value property. e.g. - /// BooleanVariable boolVar = flowchart.GetVariable("MyBool") as BooleanVariable; - /// boolVar.Value = false; - /// - Variable GetVariable(string key); - - /// - /// Returns the variable with the specified key, or null if the key is not found. - /// You can then access the variable's value using the Value property. e.g. - /// BooleanVariable boolVar = flowchart.GetVariable("MyBool"); - /// boolVar.Value = false; - /// - T GetVariable(string key) where T : Variable; - - /// - /// Register a new variable with the Flowchart at runtime. - /// The variable should be added as a component on the Flowchart game object. - /// - void SetVariable(string key, T newvariable) where T : Variable; - - /// - /// Gets a list of all variables with public scope in this Flowchart. - /// - List GetPublicVariables(); - - /// - /// Gets the value of a boolean variable. - /// Returns false if the variable key does not exist. - /// - bool GetBooleanVariable(string key); - - /// - /// Sets the value of a boolean variable. - /// The variable must already be added to the list of variables for this Flowchart. - /// - void SetBooleanVariable(string key, bool value); - - /// - /// Gets the value of an integer variable. - /// Returns 0 if the variable key does not exist. - /// - int GetIntegerVariable(string key); - - /// - /// Sets the value of an integer variable. - /// The variable must already be added to the list of variables for this Flowchart. - /// - void SetIntegerVariable(string key, int value); - - /// - /// Gets the value of a float variable. - /// Returns 0 if the variable key does not exist. - /// - float GetFloatVariable(string key); - - /// - /// Sets the value of a float variable. - /// The variable must already be added to the list of variables for this Flowchart. - /// - void SetFloatVariable(string key, float value); - - /// - /// Gets the value of a string variable. - /// Returns the empty string if the variable key does not exist. - /// - string GetStringVariable(string key); - - /// - /// Sets the value of a string variable. - /// The variable must already be added to the list of variables for this Flowchart. - /// - void SetStringVariable(string key, string value); - - /// - /// Set the block objects to be hidden or visible depending on the hideComponents property. - /// - void UpdateHideFlags(); - - /// - /// Clears the list of selected commands. - /// - void ClearSelectedCommands(); - - /// - /// Adds a command to the list of selected commands. - /// - void AddSelectedCommand(Command command); - - /// - /// Reset the commands and variables in the Flowchart. - /// - void Reset(bool resetCommands, bool resetVariables); - - /// - /// Override this in a Flowchart subclass to filter which commands are shown in the Add Command list. - /// - bool IsCommandSupported(CommandInfoAttribute commandInfo); - - /// - /// Returns true if there are any executing blocks in this Flowchart. - /// - bool HasExecutingBlocks(); - - /// - /// Returns a list of all executing blocks in this Flowchart. - /// - List GetExecutingBlocks(); - - /// - /// Substitute variables in the input text with the format {$VarName} - /// This will first match with private variables in this Flowchart, and then - /// with public variables in all Flowcharts in the scene (and any component - /// in the scene that implements StringSubstituter.ISubstitutionHandler). - /// - string SubstituteVariables(string input); - } -} diff --git a/Assets/Fungus/Scripts/Interfaces/IFlowchart.cs.meta b/Assets/Fungus/Scripts/Interfaces/IFlowchart.cs.meta deleted file mode 100644 index 295020cd..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IFlowchart.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: e0dd617b954d242bdb37e9c5de4f63cc -timeCreated: 1473856422 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IFungusState.cs b/Assets/Fungus/Scripts/Interfaces/IFungusState.cs deleted file mode 100644 index 31456586..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IFungusState.cs +++ /dev/null @@ -1,17 +0,0 @@ -using UnityEngine; -using System.Collections; - -namespace Fungus -{ - /// - /// Used by the Flowchart window to serialize the currently active Flowchart object - /// so that the same Flowchart can be displayed while editing & playing. - /// - public interface IFungusState - { - /// - /// The currently selected Flowchart. - /// - Flowchart SelectedFlowchart { get; set; } - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IFungusState.cs.meta b/Assets/Fungus/Scripts/Interfaces/IFungusState.cs.meta deleted file mode 100644 index 50745bf6..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IFungusState.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 36cb688eedcc4436780e68405a4ba494 -timeCreated: 1474015940 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/ILocalizable.cs b/Assets/Fungus/Scripts/Interfaces/ILocalizable.cs new file mode 100644 index 00000000..47dd863b --- /dev/null +++ b/Assets/Fungus/Scripts/Interfaces/ILocalizable.cs @@ -0,0 +1,35 @@ +// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; + +namespace Fungus +{ + /// + /// An item of localizeable text. + /// + public interface ILocalizable + { + /// + /// Gets the standard (non-localized) text. + /// + string GetStandardText(); + + /// + /// Sets the standard (non-localized) text. + /// + /// Standard text. + void SetStandardText(string standardText); + + /// + /// Gets the description used to help localizers. + /// + /// The description. + string GetDescription(); + + /// + /// Gets the unique string identifier. + /// + string GetStringId(); + } +} diff --git a/Assets/Fungus/Scripts/Interfaces/ILocalization.cs.meta b/Assets/Fungus/Scripts/Interfaces/ILocalizable.cs.meta similarity index 100% rename from Assets/Fungus/Scripts/Interfaces/ILocalization.cs.meta rename to Assets/Fungus/Scripts/Interfaces/ILocalizable.cs.meta diff --git a/Assets/Fungus/Scripts/Interfaces/ILocalization.cs b/Assets/Fungus/Scripts/Interfaces/ILocalization.cs deleted file mode 100644 index bbc5cd71..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ILocalization.cs +++ /dev/null @@ -1,83 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; - -namespace Fungus -{ - /// - /// Multi-language localization support. - /// - public interface ILocalization - { - /// - /// Language to use at startup, usually defined by a two letter language code (e.g DE = German). - /// - string ActiveLanguage { get; } - - /// - /// CSV file containing localization data which can be easily edited in a spreadsheet tool. - /// - TextAsset LocalizationFile { get; } - - /// - /// Stores any notification message from export / import methods. - /// - string NotificationText { get; set; } - - /// - /// Convert all text items and localized strings to an easy to edit CSV format. - /// - string GetCSVData(); - - /// - /// Scan a localization CSV file and copies the strings for the specified language code - /// into the text properties of the appropriate scene objects. - /// - void SetActiveLanguage(string languageCode, bool forceUpdateSceneText = false); - - /// - /// Populates the text property of a single scene object with a new text value. - /// - bool PopulateTextProperty(string stringId, string newText); - - /// - /// Returns all standard text for localizeable text in the scene using an - /// easy to edit custom text format. - /// - string GetStandardText(); - - /// - /// Sets standard text on scene objects by parsing a text data file. - /// - void SetStandardText(string textData); - } - - /// - /// An item of localizeable text. - /// - public interface ILocalizable - { - /// - /// Gets the standard (non-localized) text. - /// - string GetStandardText(); - - /// - /// Sets the standard (non-localized) text. - /// - /// Standard text. - void SetStandardText(string standardText); - - /// - /// Gets the description used to help localizers. - /// - /// The description. - string GetDescription(); - - /// - /// Gets the unique string identifier. - /// - string GetStringId(); - } -} diff --git a/Assets/Fungus/Scripts/Interfaces/IMenuDialog.cs b/Assets/Fungus/Scripts/Interfaces/IMenuDialog.cs deleted file mode 100644 index 9d000f89..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IMenuDialog.cs +++ /dev/null @@ -1,81 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine.UI; -using MoonSharp.Interpreter; -using System.Collections; - -namespace Fungus -{ - /// - /// Presents multiple choice buttons to the players. - /// - public interface IMenuDialog - { - /// - /// A cached list of button objects in the menu dialog. - /// - /// The cached buttons. - Button[] CachedButtons { get; } - - /// - /// A cached slider object used for the timer in the menu dialog. - /// - /// The cached slider. - Slider CachedSlider { get; } - - /// - /// Sets the active state of the Menu Dialog gameobject. - /// - void SetActive(bool state); - - /// - /// Clear all displayed options in the Menu Dialog. - /// - void Clear(); - - /// - /// Hides any currently displayed Say Dialog. - /// - void HideSayDialog(); - - /// - /// Adds the option to the list of displayed options. Calls a Block when selected. - /// Will cause the Menu dialog to become visible if it is not already visible. - /// - /// true, if the option was added successfully. - /// The option text to display on the button. - /// If false, the option is displayed but is not selectable. - /// Block to execute when the option is selected. - bool AddOption(string text, bool interactable, Block targetBlock); - - /// - /// Adds the option to the list of displayed options, calls a Lua function when selected. - /// Will cause the Menu dialog to become visible if it is not already visible. - /// - /// true, if the option was added successfully. - bool AddOption(string text, bool interactable, ILuaEnvironment luaEnv, Closure callBack); - - /// - /// Show a timer during which the player can select an option. Calls a Block when the timer expires. - /// - /// The duration during which the player can select an option. - /// Block to execute if the player does not select an option in time. - void ShowTimer(float duration, Block targetBlock); - - /// - /// Show a timer during which the player can select an option. Calls a Lua function when the timer expires. - /// - IEnumerator ShowTimer(float duration, ILuaEnvironment luaEnv, Closure callBack); - - /// - /// Returns true if the Menu Dialog is currently displayed. - /// - bool IsActive(); - - /// - /// Returns the number of currently displayed options. - /// - int DisplayedOptionsCount { get; } - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IMenuDialog.cs.meta b/Assets/Fungus/Scripts/Interfaces/IMenuDialog.cs.meta deleted file mode 100644 index 56a427eb..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IMenuDialog.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 88b3741e7161f40d3b6166170b69c55e -timeCreated: 1473425656 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IMusicController.cs b/Assets/Fungus/Scripts/Interfaces/IMusicController.cs deleted file mode 100644 index 92735861..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IMusicController.cs +++ /dev/null @@ -1,48 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; - -namespace Fungus -{ - /// - /// Music manager which provides basic music and sound effect functionality. - /// Music playback persists across scene loads. - /// - public interface IMusicController - { - /// - /// Plays game music using an audio clip. - /// One music clip may be played at a time. - /// - void PlayMusic(AudioClip musicClip, bool loop, float fadeDuration, float atTime); - - /// - /// Plays a sound effect once, at the specified volume. - /// - /// The sound effect clip to play. - /// The volume level of the sound effect. - void PlaySound(AudioClip soundClip, float volume); - - /// - /// Shifts the game music pitch to required value over a period of time. - /// - /// The new music pitch value. - /// The length of time in seconds needed to complete the pitch change. - /// A delegate method to call when the pitch shift has completed. - void SetAudioPitch(float pitch, float duration, System.Action onComplete); - - /// - /// Fades the game music volume to required level over a period of time. - /// - /// The new music volume value [0..1] - /// The length of time in seconds needed to complete the volume change. - /// Delegate function to call when fade completes. - void SetAudioVolume(float volume, float duration, System.Action onComplete); - - /// - /// Stops playing game music. - /// - void StopMusic(); - } -} diff --git a/Assets/Fungus/Scripts/Interfaces/IMusicController.cs.meta b/Assets/Fungus/Scripts/Interfaces/IMusicController.cs.meta deleted file mode 100644 index 520e1565..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IMusicController.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: efedec0242be143678aaa7075aa5467e -timeCreated: 1473429999 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs b/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs deleted file mode 100644 index e6254a10..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs +++ /dev/null @@ -1,139 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using MoonSharp.Interpreter; -using Fungus.Utils; - -namespace Fungus -{ - /// - /// Types of display operations supported by portraits. - /// - public enum DisplayType - { - /// Do nothing. - None, - /// Show the portrait. - Show, - /// Hide the portrait. - Hide, - /// Replace the existing portrait. - Replace, - /// Move portrait to the front. - MoveToFront - } - - /// - /// Directions that character portraits can face. - /// - public enum FacingDirection - { - /// Unknown direction - None, - /// Facing left. - Left, - /// Facing right. - Right - } - - /// - /// Offset direction for position. - /// - public enum PositionOffset - { - /// Unknown offset direction. - None, - /// Offset applies to the left. - OffsetLeft, - /// Offset applies to the right. - OffsetRight - } - - /// - /// Controls the Portrait sprites on stage - /// - public interface IPortraitController - { - /// - /// Using all portrait options available, run any portrait command. - /// - /// Portrait Options - /// The function that will run once the portrait command finishes - void RunPortraitCommand(PortraitOptions options, System.Action onComplete); - - /// - /// Moves Character in front of other characters on stage - /// - void MoveToFront(Character character); - - /// - /// Moves Character in front of other characters on stage - /// - void MoveToFront(PortraitOptions options); - - /// - /// Shows character at a named position in the stage - /// - /// - /// Named position on stage - void Show(Character character, string position); - - /// - /// Shows character moving from a position to a position - /// - /// - /// - /// Where the character will appear - /// Where the character will move to - void Show(Character character, string portrait, string fromPosition, string toPosition); - - /// - /// From lua, you can pass an options table with named arguments - /// example: - /// stage.show{character=jill, portrait="happy", fromPosition="right", toPosition="left"} - /// Any option available in the PortraitOptions is available from Lua - /// - /// Moonsharp Table - void Show(Table optionsTable); - - /// - /// Show portrait with the supplied portrait options - /// - /// - void Show(PortraitOptions options); - - /// - /// Simple show command that shows the character with an available named portrait - /// - /// Character to show - /// Named portrait to show for the character, i.e. "angry", "happy", etc - void ShowPortrait(Character character, string portrait); - - /// - /// Simple character hide command - /// - /// Character to hide - void Hide(Character character); - - /// - /// Move the character to a position then hide it - /// - /// Character to hide - /// Where the character will disapear to - void Hide(Character character, string toPosition); - - /// - /// From lua, you can pass an options table with named arguments - /// example: - /// stage.hide{character=jill, toPosition="left"} - /// Any option available in the PortraitOptions is available from Lua - /// - /// Moonsharp Table - void Hide(Table optionsTable); - - /// - /// Hide portrait with provided options - /// - void Hide(PortraitOptions options); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs.meta b/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs.meta deleted file mode 100644 index d25bf761..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IPortraitController.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 51067f95c67324a0ba05a260dced682f -timeCreated: 1473685101 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/ISayDialog.cs b/Assets/Fungus/Scripts/Interfaces/ISayDialog.cs deleted file mode 100644 index a6882b36..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ISayDialog.cs +++ /dev/null @@ -1,75 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; -using System.Collections; - -namespace Fungus -{ - /// - /// Display story text in a visual novel style dialog box. - /// - public interface ISayDialog - { - /// - /// Sets the active state of the Say Dialog gameobject. - /// - void SetActive(bool state); - - /// - /// Sets the active speaking character. - /// - /// The active speaking character. - /// An optional Flowchart to use for variable substitution in the character name string. - void SetCharacter(ICharacter character, IFlowchart flowchart = null); - - /// - /// Sets the character image to display on the Say Dialog. - /// - void SetCharacterImage(Sprite image); - - /// - /// Sets the character name to display on the Say Dialog. - /// - void SetCharacterName(string name, Color color); - - /// - /// Write a line of story text to the Say Dialog. Starts coroutine automatically. - /// - /// The text to display. - /// Clear any previous text in the Say Dialog. - /// Wait for player input before continuing once text is written. - /// Fade out the Say Dialog when writing and player input has finished. - /// Stop any existing voiceover audio before writing starts. - /// Voice over audio clip to play. - /// Callback to execute when writing and player input have finished. - void Say(string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, bool stopVoiceover, AudioClip voiceOverClip, System.Action onComplete); - - /// - /// Write a line of story text to the Say Dialog. Must be started as a coroutine. - /// - /// The text to display. - /// Clear any previous text in the Say Dialog. - /// Wait for player input before continuing once text is written. - /// Fade out the Say Dialog when writing and player input has finished. - /// Stop any existing voiceover audio before writing starts. - /// Voice over audio clip to play. - /// Callback to execute when writing and player input have finished. - IEnumerator DoSay(string text, bool clearPrevious, bool waitForInput, bool fadeWhenDone, bool stopVoiceover, AudioClip voiceOverClip, System.Action onComplete); - - /// - /// Tell the Say Dialog to fade out once writing and player input have finished. - /// - bool FadeWhenDone { set; } - - /// - /// Stop the Say Dialog while its writing text. - /// - void Stop(); - - /// - /// Stops writing text and clears the Say Dialog. - /// - void Clear(); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/ISayDialog.cs.meta b/Assets/Fungus/Scripts/Interfaces/ISayDialog.cs.meta deleted file mode 100644 index ce474358..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ISayDialog.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a1a9184c86a4048d5973b766e9fd6803 -timeCreated: 1473421269 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IStage.cs b/Assets/Fungus/Scripts/Interfaces/IStage.cs deleted file mode 100644 index cb554b1c..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IStage.cs +++ /dev/null @@ -1,66 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; -using UnityEngine.UI; -using System.Collections.Generic; - -namespace Fungus -{ - /// - /// Define a set of screen positions where character sprites can be displayed. - /// - public interface IStage - { - /// - /// Canvas object containing the stage positions. - /// - Canvas PortraitCanvas { get; } - - /// - /// Dim portraits when a character is not speaking. - /// - bool DimPortraits { get; set; } - - /// - /// Duration for fading character portraits in / out. - /// - float FadeDuration { get; set; } - - /// - /// Duration for moving characters to a new position. - /// - float MoveDuration { get; set; } - - /// - /// Ease type for the fade tween. - /// - LeanTweenType FadeEaseType { get; } - - /// - /// Constant offset to apply to portrait position. - /// - Vector2 ShiftOffset { get; } - - /// - /// The position object where characters appear by default. - /// - Image DefaultPosition { get; } - - /// - /// List of stage position rect transforms in the stage. - /// - List Positions { get; } - - /// - /// List of currently active characters on the stage. - /// - List CharactersOnStage { get; } - - /// - /// Searches the stage's named positions - /// If none matches the string provided, give a warning and return a new RectTransform - /// - RectTransform GetPosition(string positionString); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IStage.cs.meta b/Assets/Fungus/Scripts/Interfaces/IStage.cs.meta deleted file mode 100644 index 55f45506..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IStage.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: a88bde623f95a46e49febd46fe50b19c -timeCreated: 1473689190 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/ITextTagParser.cs.meta b/Assets/Fungus/Scripts/Interfaces/ITextTagParser.cs.meta deleted file mode 100644 index 1d4370e0..00000000 --- a/Assets/Fungus/Scripts/Interfaces/ITextTagParser.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 1e3f4aab68276483e9d40b120cc1cafc -timeCreated: 1473756939 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IVariable.cs b/Assets/Fungus/Scripts/Interfaces/IVariable.cs deleted file mode 100644 index 38ef0bb1..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IVariable.cs +++ /dev/null @@ -1,56 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -namespace Fungus -{ - /// - /// Standard comparison operators. - /// - public enum CompareOperator - { - /// == mathematical operator. - Equals, - /// != mathematical operator. - NotEquals, - /// < mathematical operator. - LessThan, - /// > mathematical operator. - GreaterThan, - /// <= mathematical operator. - LessThanOrEquals, - /// >= mathematical operator. - GreaterThanOrEquals - } - - /// - /// Scope types for Variables. - /// - public enum VariableScope - { - /// Can only be accessed by commands in the same Flowchart. - Private, - /// Can be accessed from any command in any Flowchart. - Public - } - - /// - /// A Fungus variable that can be used with Commands. - /// - public interface IVariable - { - /// - /// Visibility scope for the variable. - /// - VariableScope Scope { get; } - - /// - /// String identifier for the variable. - /// - string Key { get; set; } - - /// - /// Callback to reset the variable if the Flowchart is reset. - /// - void OnReset(); - } -} diff --git a/Assets/Fungus/Scripts/Interfaces/IVariable.cs.meta b/Assets/Fungus/Scripts/Interfaces/IVariable.cs.meta deleted file mode 100644 index 29e4d18f..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IVariable.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 75ff90e0b811142d39cc9031dbf4b992 -timeCreated: 1473856441 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IView.cs b/Assets/Fungus/Scripts/Interfaces/IView.cs deleted file mode 100644 index a1e55e97..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IView.cs +++ /dev/null @@ -1,29 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; - -namespace Fungus -{ - /// - /// Defines a camera view point. - /// The position and rotation are specified using the game object's transform, so this class only needs to specify the ortographic view size. - /// - public interface IView - { - /// - /// Orthographic size of the camera view in world units. - /// - float ViewSize { get; set; } - - /// - /// Aspect ratio of the primary view rectangle. e.g. a 4:3 aspect ratio = 1.333. - /// - Vector2 PrimaryAspectRatio { get; set; } - - /// - /// Aspect ratio of the secondary view rectangle. e.g. a 2:1 aspect ratio = 2/1 = 2.0. - /// - Vector2 SecondaryAspectRatio { get; set; } - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IView.cs.meta b/Assets/Fungus/Scripts/Interfaces/IView.cs.meta deleted file mode 100644 index 9dde8775..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IView.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: d50490011ddfc4e6ea394a4bfbf815e0 -timeCreated: 1473676064 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Fungus/Scripts/Interfaces/IWriter.cs b/Assets/Fungus/Scripts/Interfaces/IWriter.cs deleted file mode 100644 index 62c18c67..00000000 --- a/Assets/Fungus/Scripts/Interfaces/IWriter.cs +++ /dev/null @@ -1,85 +0,0 @@ -// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). -// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) - -using UnityEngine; -using System.Collections; - -namespace Fungus -{ - /// - /// Writes text using a typewriter effect to a UI text object. - /// - public interface IWriter - { - /// - /// This property is true when the writer is writing text or waiting (i.e. still processing tokens). - /// - bool IsWriting { get; } - - /// - /// This property is true when the writer is waiting for user input to continue. - /// - bool IsWaitingForInput { get; } - - /// - /// Stop writing text. - /// - void Stop(); - - /// - /// Writes text using a typewriter effect to a UI text object. - /// - /// Text to be written - /// If true clears the previous text. - /// Writes the text and then waits for player input before calling onComplete. - /// Stops any currently playing audioclip. - /// Audio clip to play when text starts writing. - /// Callback to call when writing is finished. - IEnumerator Write(string content, bool clear, bool waitForInput, bool stopAudio, AudioClip audioClip, System.Action onComplete); - - /// - /// Sets the color property of the text UI object. - /// - void SetTextColor(Color textColor); - - /// - /// Sets the alpha component of the color property of the text UI object. - /// - void SetTextAlpha(float textAlpha); - } - - /// - /// Implement this interface to be notified about Writer events. - /// - public interface IWriterListener - { - /// - /// Called when a user input event (e.g. a click) has been handled by the Writer. - /// - void OnInput(); - - /// - /// Called when the Writer starts writing new text. - /// - /// An optional audioClip sound effect can be supplied (e.g. for voiceover) - void OnStart(AudioClip audioClip); - - /// Called when the Writer has paused writing text (e.g. on a {wi} tag). - void OnPause(); - - /// Called when the Writer has resumed writing text. - void OnResume(); - - /// Called when the Writer has finished writing text. - /// Controls whether audio should be stopped when writing ends. - void OnEnd(bool stopAudio); - - /// Called every time the Writer writes a new character glyph. - void OnGlyph(); - - /// - /// Called when voiceover should start. - /// - void OnVoiceover(AudioClip voiceOverClip); - } -} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IWriterListener.cs b/Assets/Fungus/Scripts/Interfaces/IWriterListener.cs new file mode 100644 index 00000000..c770570d --- /dev/null +++ b/Assets/Fungus/Scripts/Interfaces/IWriterListener.cs @@ -0,0 +1,43 @@ +// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus). +// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE) + +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + /// + /// Implement this interface to be notified about Writer events. + /// + public interface IWriterListener + { + /// + /// Called when a user input event (e.g. a click) has been handled by the Writer. + /// + void OnInput(); + + /// + /// Called when the Writer starts writing new text. + /// + /// An optional audioClip sound effect can be supplied (e.g. for voiceover) + void OnStart(AudioClip audioClip); + + /// Called when the Writer has paused writing text (e.g. on a {wi} tag). + void OnPause(); + + /// Called when the Writer has resumed writing text. + void OnResume(); + + /// Called when the Writer has finished writing text. + /// Controls whether audio should be stopped when writing ends. + void OnEnd(bool stopAudio); + + /// Called every time the Writer writes a new character glyph. + void OnGlyph(); + + /// + /// Called when voiceover should start. + /// + void OnVoiceover(AudioClip voiceOverClip); + } +} \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Interfaces/IWriter.cs.meta b/Assets/Fungus/Scripts/Interfaces/IWriterListener.cs.meta similarity index 100% rename from Assets/Fungus/Scripts/Interfaces/IWriter.cs.meta rename to Assets/Fungus/Scripts/Interfaces/IWriterListener.cs.meta diff --git a/Assets/Fungus/Scripts/Utils/ConversationManager.cs b/Assets/Fungus/Scripts/Utils/ConversationManager.cs index 759c95ec..d3b1e254 100644 --- a/Assets/Fungus/Scripts/Utils/ConversationManager.cs +++ b/Assets/Fungus/Scripts/Utils/ConversationManager.cs @@ -9,7 +9,10 @@ using System.Text; namespace Fungus.Utils { - public class ConversationManager : IConversationManager + /// + /// Helper class to manage parsing and executing the conversation format. + /// + public class ConversationManager { protected struct ConversationItem { @@ -73,9 +76,9 @@ namespace Fungus.Utils return results.ToArray(); } - protected ISayDialog GetSayDialog(Character character) + protected SayDialog GetSayDialog(Character character) { - ISayDialog sayDialog = null; + SayDialog sayDialog = null; if (character != null) { if (character.SetSayDialog != null) @@ -261,14 +264,20 @@ namespace Fungus.Utils return item; } - #region IConversationManager + #region Public methods + /// + /// Caches the character objects in the scene for fast lookup during conversations. + /// public void PopulateCharacterCache() { // cache characters for faster lookup characters = UnityEngine.Object.FindObjectsOfType(); } + /// + /// Parse and execute a conversation string. + /// public IEnumerator DoConversation(string conv) { if (string.IsNullOrEmpty(conv)) @@ -302,7 +311,7 @@ namespace Fungus.Utils currentPortrait = item.Portrait; currentPosition = item.Position; - ISayDialog sayDialog = GetSayDialog(currentCharacter); + var sayDialog = GetSayDialog(currentCharacter); if (sayDialog == null) { diff --git a/Assets/Fungus/Scripts/Utils/TextTagParser.cs b/Assets/Fungus/Scripts/Utils/TextTagParser.cs index 868d9140..7060135a 100644 --- a/Assets/Fungus/Scripts/Utils/TextTagParser.cs +++ b/Assets/Fungus/Scripts/Utils/TextTagParser.cs @@ -10,39 +10,9 @@ namespace Fungus.Utils /// /// Parses a string for special Fungus text tags. /// - public class TextTagParser : ITextTagParser + public static class TextTagParser { - public static string GetTagHelp() - { - return "" + - "\t{b} Bold Text {/b}\n" + - "\t{i} Italic Text {/i}\n" + - "\t{color=red} Color Text (color){/color}\n" + - "\t{size=30} Text size {/size}\n" + - "\n" + - "\t{s}, {s=60} Writing speed (chars per sec){/s}\n" + - "\t{w}, {w=0.5} Wait (seconds)\n" + - "\t{wi} Wait for input\n" + - "\t{wc} Wait for input and clear\n" + - "\t{wp}, {wp=0.5} Wait on punctuation (seconds){/wp}\n" + - "\t{c} Clear\n" + - "\t{x} Exit, advance to the next command without waiting for input\n" + - "\n" + - "\t{vpunch=10,0.5} Vertically punch screen (intensity,time)\n" + - "\t{hpunch=10,0.5} Horizontally punch screen (intensity,time)\n" + - "\t{punch=10,0.5} Punch screen (intensity,time)\n" + - "\t{flash=0.5} Flash screen (duration)\n" + - "\n" + - "\t{audio=AudioObjectName} Play Audio Once\n" + - "\t{audioloop=AudioObjectName} Play Audio Loop\n" + - "\t{audiopause=AudioObjectName} Pause Audio\n" + - "\t{audiostop=AudioObjectName} Stop Audio\n" + - "\n" + - "\t{m=MessageName} Broadcast message\n" + - "\t{$VarName} Substitute variable"; - } - - protected virtual void AddWordsToken(List tokenList, string words) + private static void AddWordsToken(List tokenList, string words) { TextTagToken token = new TextTagToken(); token.type = TokenType.Words; @@ -51,7 +21,7 @@ namespace Fungus.Utils tokenList.Add(token); } - protected virtual void AddTagToken(List tokenList, string tagText) + private static void AddTagToken(List tokenList, string tagText) { if (tagText.Length < 3 || tagText.Substring(0,1) != "{" || @@ -199,7 +169,7 @@ namespace Fungus.Utils } } - protected virtual List ExtractParameters(string input) + private static List ExtractParameters(string input) { List paramsList = new List(); int index = input.IndexOf('='); @@ -217,9 +187,45 @@ namespace Fungus.Utils return paramsList; } - #region ITextTagParser implementation + #region Public methods + + /// + /// Returns a description of the supported tags. + /// + public static string GetTagHelp() + { + return "" + + "\t{b} Bold Text {/b}\n" + + "\t{i} Italic Text {/i}\n" + + "\t{color=red} Color Text (color){/color}\n" + + "\t{size=30} Text size {/size}\n" + + "\n" + + "\t{s}, {s=60} Writing speed (chars per sec){/s}\n" + + "\t{w}, {w=0.5} Wait (seconds)\n" + + "\t{wi} Wait for input\n" + + "\t{wc} Wait for input and clear\n" + + "\t{wp}, {wp=0.5} Wait on punctuation (seconds){/wp}\n" + + "\t{c} Clear\n" + + "\t{x} Exit, advance to the next command without waiting for input\n" + + "\n" + + "\t{vpunch=10,0.5} Vertically punch screen (intensity,time)\n" + + "\t{hpunch=10,0.5} Horizontally punch screen (intensity,time)\n" + + "\t{punch=10,0.5} Punch screen (intensity,time)\n" + + "\t{flash=0.5} Flash screen (duration)\n" + + "\n" + + "\t{audio=AudioObjectName} Play Audio Once\n" + + "\t{audioloop=AudioObjectName} Play Audio Loop\n" + + "\t{audiopause=AudioObjectName} Pause Audio\n" + + "\t{audiostop=AudioObjectName} Stop Audio\n" + + "\n" + + "\t{m=MessageName} Broadcast message\n" + + "\t{$VarName} Substitute variable"; + } - public virtual List Tokenize(string storyText) + /// + /// Processes a block of story text and converts it to a list of tokens. + /// + public static List Tokenize(string storyText) { List tokens = new List(); diff --git a/Assets/Fungus/Thirdparty/FungusLua/Resources/Types/FungusTypes.txt b/Assets/Fungus/Thirdparty/FungusLua/Resources/Types/FungusTypes.txt index 23a2c0f6..d67f7c5d 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Resources/Types/FungusTypes.txt +++ b/Assets/Fungus/Thirdparty/FungusLua/Resources/Types/FungusTypes.txt @@ -1,38 +1,37 @@ { "registerTypes" : [ - "Fungus.AnimatorVariable", - "Fungus.AudioSourceVariable", + "Fungus.Variables.AnimatorVariable", + "Fungus.Variables.AudioSourceVariable", "Fungus.Block", - "Fungus.BooleanVariable", + "Fungus.Variables.BooleanVariable", "Fungus.Character", - "Fungus.ColorVariable", + "Fungus.Variables.ColorVariable", "Fungus.Command", "Fungus.CommandInfoAttribute", "Fungus.FacingDirection", - "Fungus.FloatVariable", + "Fungus.Variables.FloatVariable", "Fungus.Flowchart", "Fungus.FungusPrefs", "Fungus.LuaEnvironment", "Fungus.LuaUtils", - "Fungus.GameObjectVariable", - "Fungus.IntegerVariable", - "Fungus.Label", - "Fungus.MaterialVariable", + "Fungus.Variables.GameObjectVariable", + "Fungus.Variables.IntegerVariable", + "Fungus.Commands.Label", + "Fungus.Variables.MaterialVariable", "Fungus.MenuDialog", - "Fungus.ObjectVariable", + "Fungus.Variables.ObjectVariable", "Fungus.PODTypeFactory", - "Fungus.PortraitState", + "Fungus.Utils.PortraitState", "Fungus.SayDialog", - "Fungus.SpriteVariable", - "Fungus.StringVariable", + "Fungus.Variables.SpriteVariable", + "Fungus.Variables.StringVariable", "Fungus.Task", - "Fungus.TextureVariable", - "Fungus.TransformVariable", + "Fungus.Variables.TextureVariable", + "Fungus.Variables.TransformVariable", "Fungus.Variable", - "Fungus.Vector2Variable", - "Fungus.Vector3Variable" + "Fungus.Variables.Vector2Variable", + "Fungus.Variables.Vector3Variable" ], "extensionTypes" : [ - "Fungus.LuaExtensions" ] } \ No newline at end of file diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Components/LuaUtils.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Components/LuaUtils.cs index 553d6d22..14935f9f 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Components/LuaUtils.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Components/LuaUtils.cs @@ -430,9 +430,9 @@ namespace Fungus return conversationManager.DoConversation(conv); } - public void SetSayDialog(ISayDialog sayDialog) + public void SetSayDialog(SayDialog sayDialog) { - SayDialog.activeSayDialog = sayDialog; + SayDialog.ActiveSayDialog = sayDialog; } #endregion diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Interfaces/ILuaUtils.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Interfaces/ILuaUtils.cs index 0908842c..73e9ddaa 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Interfaces/ILuaUtils.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Interfaces/ILuaUtils.cs @@ -85,6 +85,6 @@ namespace Fungus /// Sync the active say dialog with what Lua thinks the SayDialog should be /// /// - void SetSayDialog(ISayDialog sayDialog); + void SetSayDialog(SayDialog sayDialog); } } \ No newline at end of file diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Utils/FungusPrefs.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Utils/FungusPrefs.cs index b44e3ec1..14b6d8ad 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/Utils/FungusPrefs.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/Utils/FungusPrefs.cs @@ -9,8 +9,10 @@ namespace Fungus /// Wrapper class for PlayerPrefs that adds the concept of multiple save slots. /// Save slots allow you to store multiple player save profiles. /// - public class FungusPrefs + public static class FungusPrefs { + #region Public methods + /// /// Deletes all saved values for all slots. /// @@ -106,5 +108,7 @@ namespace Fungus { return slot.ToString() + ":" + key; } + + #endregion } } \ No newline at end of file diff --git a/Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity b/Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity index c830ea62..42fbfa00 100644 --- a/Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity +++ b/Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity @@ -8,25 +8,25 @@ SceneSettings: m_PVSPortalsArray: [] m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 7 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,15 +37,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} ---- !u!127 &3 -LevelGameManager: - m_ObjectHideFlags: 0 + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 7 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -56,19 +53,25 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 4 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 + m_DirectLightInLightProbes: 1 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 - m_LightmapSnapshot: {fileID: 0} + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} m_RuntimeCPUUsage: 25 --- !u!196 &5 NavMeshSettings: @@ -76,15 +79,15 @@ NavMeshSettings: m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 + cellSize: 0.16666666 manualCellSize: 0 m_NavMeshData: {fileID: 0} --- !u!1 &19757133 @@ -157,8 +160,10 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!224 &19757137 RectTransform: m_ObjectHideFlags: 0 @@ -168,11 +173,12 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 245689044} - {fileID: 2096462795} m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 8 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -215,7 +221,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_RootOrder - value: 4 + value: 5 objectReference: {fileID: 0} - target: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_Name @@ -225,6 +231,10 @@ Prefab: propertyPath: useEventSystem value: 1 objectReference: {fileID: 0} + - target: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} + propertyPath: hoverCursor + value: + objectReference: {fileID: 2800000, guid: 22eb050bacf8c401ca8503e24bff3570, type: 3} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_IsPrefabParent: 0 @@ -255,15 +265,16 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 349486055} m_Father: {fileID: 19757137} m_RootOrder: 0 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -166, y: 63} m_SizeDelta: {x: 185, y: 65} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &245689045 MonoBehaviour: m_ObjectHideFlags: 0 @@ -284,11 +295,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -318,6 +329,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Type: 1 m_PreserveAspect: 0 @@ -382,14 +399,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 1 @@ -401,10 +418,12 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 + m_TargetEye: 3 m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 --- !u!4 &268187672 Transform: m_ObjectHideFlags: 0 @@ -412,8 +431,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 268187667} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -.0500000007, y: -.540000021, z: -10} + m_LocalPosition: {x: -0.05, y: -0.54, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -468,9 +488,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 + m_RootOrder: 1 --- !u!1 &349486054 GameObject: m_ObjectHideFlags: 0 @@ -497,6 +518,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 245689044} m_RootOrder: 0 @@ -504,7 +526,7 @@ RectTransform: m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &349486056 MonoBehaviour: m_ObjectHideFlags: 0 @@ -517,7 +539,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_FontSize: 14 @@ -526,6 +554,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -546,7 +575,7 @@ Prefab: m_Modifications: - target: {fileID: 400000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} propertyPath: m_LocalPosition.x - value: 2.99000001 + value: 2.99 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} propertyPath: m_LocalPosition.y @@ -574,26 +603,26 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} propertyPath: m_RootOrder - value: 2 + value: 3 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} m_IsPrefabParent: 0 ---- !u!1 &591590528 +--- !u!1 &591590528 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_PrefabInternal: {fileID: 1373034542} ---- !u!114 &591590529 +--- !u!114 &591590529 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_PrefabInternal: {fileID: 1373034542} m_Script: {fileID: 11500000, guid: cc03961113fa349c09cb06ef2911013d, type: 3} ---- !u!1 &606394391 +--- !u!1 &606394391 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} m_PrefabInternal: {fileID: 442175927} ---- !u!58 &606394392 +--- !u!58 &606394392 stripped CircleCollider2D: m_PrefabParentObject: {fileID: 5800000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} @@ -635,14 +664,15 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 9 ---- !u!1 &1081858233 + m_RootOrder: 10 +--- !u!1 &1081858233 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} m_PrefabInternal: {fileID: 2135880372} ---- !u!114 &1081858236 +--- !u!114 &1081858236 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11400000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} @@ -691,9 +721,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 4 --- !u!1001 &1373034542 Prefab: m_ObjectHideFlags: 0 @@ -703,11 +734,11 @@ Prefab: m_Modifications: - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_LocalPosition.x - value: 3.18000007 + value: 3.18 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_LocalPosition.y - value: -3.1500001 + value: -3.15 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_LocalPosition.z @@ -731,7 +762,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_RootOrder - value: 5 + value: 6 objectReference: {fileID: 0} - target: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_Name @@ -752,21 +783,6 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_IsPrefabParent: 0 ---- !u!115 &1447151998 -MonoScript: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: - serializedVersion: 4 - m_Script: - m_DefaultReferences: {} - m_Icon: {fileID: 0} - m_ExecutionOrder: 0 - m_ClassName: SetActive - m_Namespace: Fungus - m_AssemblyName: Assembly-CSharp.dll - m_IsEditorScript: 0 --- !u!1 &1597904418 GameObject: m_ObjectHideFlags: 0 @@ -800,7 +816,8 @@ MonoBehaviour: m_SubmitButton: Submit m_CancelButton: Cancel m_InputActionsPerSecond: 10 - m_AllowActivationOnMobileDevice: 0 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 --- !u!114 &1597904420 MonoBehaviour: m_ObjectHideFlags: 0 @@ -824,14 +841,15 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 8 ---- !u!1 &1637100245 + m_RootOrder: 9 +--- !u!1 &1637100245 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_PrefabInternal: {fileID: 228925351} ---- !u!114 &1637100246 +--- !u!114 &1637100246 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} @@ -863,6 +881,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 2096462795} m_RootOrder: 0 @@ -870,7 +889,7 @@ RectTransform: m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1966497755 MonoBehaviour: m_ObjectHideFlags: 0 @@ -883,7 +902,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_FontSize: 14 @@ -892,6 +917,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -917,7 +943,6 @@ GameObject: - 114: {fileID: 2019116683} - 114: {fileID: 2019116680} - 114: {fileID: 2019116669} - - 114: {fileID: 2019116670} - 114: {fileID: 2019116677} - 114: {fileID: 2019116676} - 114: {fileID: 2019116675} @@ -1011,29 +1036,7 @@ MonoBehaviour: eventHandler: {fileID: 2019116681} commandList: - {fileID: 2019116672} - - {fileID: 2019116670} - {fileID: 2019116671} ---- !u!114 &2019116670 -MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2019116667} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1447151998} - m_Name: - m_EditorClassIdentifier: - itemId: 0 - errorMessage: - indentLevel: 0 - _targetGameObject: - gameObjectRef: {fileID: 0} - gameObjectVal: {fileID: 1081858233} - activeState: - booleanRef: {fileID: 0} - booleanVal: 0 - targetGameObjectOLD: {fileID: 0} --- !u!114 &2019116671 MonoBehaviour: m_ObjectHideFlags: 2 @@ -1046,7 +1049,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 6 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1066,7 +1068,7 @@ MonoBehaviour: durationOLD: 0 _offset: vector3Ref: {fileID: 0} - vector3Val: {x: .5, y: .5, z: 0} + vector3Val: {x: 0.5, y: 0.5, z: 0} offsetOLD: {x: 0, y: 0, z: 0} --- !u!114 &2019116672 MonoBehaviour: @@ -1080,7 +1082,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 5 - errorMessage: indentLevel: 0 commenterName: commentText: Destroy the dragged object and scale up the target object @@ -1109,7 +1110,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 4 - errorMessage: indentLevel: 0 commenterName: commentText: Decrease scale when drag is cancelled @@ -1125,7 +1125,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 3 - errorMessage: indentLevel: 0 commenterName: commentText: Increase scale when drag starts @@ -1141,7 +1140,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 2 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1151,7 +1149,7 @@ MonoBehaviour: stringVal: _duration: floatRef: {fileID: 0} - floatVal: .100000001 + floatVal: 0.1 easeType: 2 loopType: 0 stopPreviousTweens: 0 @@ -1161,7 +1159,7 @@ MonoBehaviour: durationOLD: 0 _offset: vector3Ref: {fileID: 0} - vector3Val: {x: -.25, y: -.25, z: 0} + vector3Val: {x: -0.25, y: -0.25, z: 0} offsetOLD: {x: 0, y: 0, z: 0} --- !u!114 &2019116677 MonoBehaviour: @@ -1175,7 +1173,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 1 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1185,7 +1182,7 @@ MonoBehaviour: stringVal: _duration: floatRef: {fileID: 0} - floatVal: .100000001 + floatVal: 0.1 easeType: 2 loopType: 0 stopPreviousTweens: 0 @@ -1195,7 +1192,7 @@ MonoBehaviour: durationOLD: 0 _offset: vector3Ref: {fileID: 0} - vector3Val: {x: .25, y: .25, z: 0} + vector3Val: {x: 0.25, y: 0.25, z: 0} offsetOLD: {x: 0, y: 0, z: 0} --- !u!114 &2019116678 MonoBehaviour: @@ -1222,7 +1219,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 10 - errorMessage: indentLevel: 0 commenterName: commentText: Do a punch rotation effect when the dragged object stops touching the @@ -1277,7 +1273,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 9 - errorMessage: indentLevel: 0 commenterName: commentText: Do a punch position effect when the dragged object starts touching @@ -1394,7 +1389,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 11 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1425,11 +1419,12 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2019116667} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.15999997, y: .340000004, z: 0} + m_LocalPosition: {x: -1.16, y: 0.34, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 7 --- !u!114 &2019116690 MonoBehaviour: m_ObjectHideFlags: 2 @@ -1442,7 +1437,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 7 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1477,7 +1471,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 8 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1571,7 +1564,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 12 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1591,7 +1583,7 @@ MonoBehaviour: durationOLD: 0 _amount: vector3Ref: {fileID: 0} - vector3Val: {x: .5, y: .5, z: 0} + vector3Val: {x: 0.5, y: 0.5, z: 0} amountOLD: {x: 0, y: 0, z: 0} --- !u!114 &2019116696 MonoBehaviour: @@ -1618,7 +1610,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 21 - errorMessage: indentLevel: 0 cursorTexture: {fileID: 2800000, guid: 502e0c9b755f34db0b90bf78857d8a1c, type: 3} hotSpot: {x: 0, y: 0} @@ -1684,15 +1675,16 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1966497754} m_Father: {fileID: 19757137} m_RootOrder: 1 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -166, y: -157} m_SizeDelta: {x: 185, y: 65} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2096462796 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1713,11 +1705,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -1747,6 +1739,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Type: 1 m_PreserveAspect: 0 @@ -1804,6 +1802,10 @@ Prefab: propertyPath: useEventSystem value: 1 objectReference: {fileID: 0} + - target: {fileID: 11400000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} + propertyPath: hoverCursor + value: + objectReference: {fileID: 2800000, guid: 22eb050bacf8c401ca8503e24bff3570, type: 3} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/FungusExamples/DragAndDrop/DragAndDrop.unity b/Assets/FungusExamples/DragAndDrop/DragAndDrop.unity index 4f491b15..1080282b 100644 --- a/Assets/FungusExamples/DragAndDrop/DragAndDrop.unity +++ b/Assets/FungusExamples/DragAndDrop/DragAndDrop.unity @@ -8,25 +8,25 @@ SceneSettings: m_PVSPortalsArray: [] m_OcclusionBakeSettings: smallestOccluder: 5 - smallestHole: .25 + smallestHole: 0.25 backfaceThreshold: 100 --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 7 m_Fog: 0 - m_FogColor: {r: .5, g: .5, b: .5, a: 1} + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 - m_FogDensity: .00999999978 + m_FogDensity: 0.01 m_LinearFogStart: 0 m_LinearFogEnd: 300 - m_AmbientSkyColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientEquatorColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} - m_AmbientGroundColor: {r: .200000003, g: .200000003, b: .200000003, a: 1} + m_AmbientSkyColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientEquatorColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} + m_AmbientGroundColor: {r: 0.2, g: 0.2, b: 0.2, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 3 m_SkyboxMaterial: {fileID: 0} - m_HaloStrength: .5 + m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 m_HaloTexture: {fileID: 0} @@ -37,15 +37,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} ---- !u!127 &3 -LevelGameManager: - m_ObjectHideFlags: 0 + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &4 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 5 + serializedVersion: 7 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -56,19 +53,25 @@ LightmapSettings: m_EnableBakedLightmaps: 1 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 4 m_Resolution: 1 m_BakeResolution: 50 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 0 + m_DirectLightInLightProbes: 1 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 - m_LightmapSnapshot: {fileID: 0} + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} m_RuntimeCPUUsage: 25 --- !u!196 &5 NavMeshSettings: @@ -76,15 +79,15 @@ NavMeshSettings: m_ObjectHideFlags: 0 m_BuildSettings: serializedVersion: 2 - agentRadius: .5 + agentRadius: 0.5 agentHeight: 2 agentSlope: 45 - agentClimb: .400000006 + agentClimb: 0.4 ledgeDropHeight: 0 maxJumpAcrossDistance: 0 accuratePlacement: 0 minRegionArea: 2 - cellSize: .166666657 + cellSize: 0.16666666 manualCellSize: 0 m_NavMeshData: {fileID: 0} --- !u!1 &19757133 @@ -157,8 +160,10 @@ Canvas: m_ReceivesEvents: 1 m_OverrideSorting: 0 m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 m_SortingLayerID: 0 m_SortingOrder: 0 + m_TargetDisplay: 0 --- !u!224 &19757137 RectTransform: m_ObjectHideFlags: 0 @@ -168,11 +173,12 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 245689044} - {fileID: 2096462795} m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 8 m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} @@ -215,12 +221,16 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_RootOrder - value: 4 + value: 5 objectReference: {fileID: 0} - target: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_Name value: ClickableSprite1 objectReference: {fileID: 0} + - target: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} + propertyPath: hoverCursor + value: + objectReference: {fileID: 2800000, guid: 22eb050bacf8c401ca8503e24bff3570, type: 3} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_IsPrefabParent: 0 @@ -251,15 +261,16 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 349486055} m_Father: {fileID: 19757137} m_RootOrder: 0 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -166, y: 63} m_SizeDelta: {x: 185, y: 65} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &245689045 MonoBehaviour: m_ObjectHideFlags: 0 @@ -280,11 +291,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -314,6 +325,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Type: 1 m_PreserveAspect: 0 @@ -377,14 +394,14 @@ Camera: m_Enabled: 1 serializedVersion: 2 m_ClearFlags: 1 - m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844} m_NormalizedViewPortRect: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 - near clip plane: .300000012 + near clip plane: 0.3 far clip plane: 1000 field of view: 60 orthographic: 1 @@ -396,10 +413,12 @@ Camera: m_RenderingPath: -1 m_TargetTexture: {fileID: 0} m_TargetDisplay: 0 + m_TargetEye: 3 m_HDR: 0 m_OcclusionCulling: 1 m_StereoConvergence: 10 - m_StereoSeparation: .0219999999 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 --- !u!4 &268187672 Transform: m_ObjectHideFlags: 0 @@ -407,8 +426,9 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 268187667} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -.0500000007, y: -.540000021, z: -10} + m_LocalPosition: {x: -0.05, y: -0.54, z: -10} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -449,9 +469,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 0 + m_RootOrder: 1 --- !u!1 &349486054 GameObject: m_ObjectHideFlags: 0 @@ -478,6 +499,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 245689044} m_RootOrder: 0 @@ -485,7 +507,7 @@ RectTransform: m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &349486056 MonoBehaviour: m_ObjectHideFlags: 0 @@ -498,7 +520,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_FontSize: 14 @@ -507,6 +535,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -527,7 +556,7 @@ Prefab: m_Modifications: - target: {fileID: 400000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} propertyPath: m_LocalPosition.x - value: 2.99000001 + value: 2.99 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} propertyPath: m_LocalPosition.y @@ -555,26 +584,26 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} propertyPath: m_RootOrder - value: 2 + value: 3 objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} m_IsPrefabParent: 0 ---- !u!1 &591590528 +--- !u!1 &591590528 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_PrefabInternal: {fileID: 1373034542} ---- !u!114 &591590529 +--- !u!114 &591590529 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_PrefabInternal: {fileID: 1373034542} m_Script: {fileID: 11500000, guid: cc03961113fa349c09cb06ef2911013d, type: 3} ---- !u!1 &606394391 +--- !u!1 &606394391 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} m_PrefabInternal: {fileID: 442175927} ---- !u!58 &606394392 +--- !u!58 &606394392 stripped CircleCollider2D: m_PrefabParentObject: {fileID: 5800000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} @@ -616,14 +645,15 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 9 ---- !u!1 &1081858233 + m_RootOrder: 10 +--- !u!1 &1081858233 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} m_PrefabInternal: {fileID: 2135880372} ---- !u!114 &1081858236 +--- !u!114 &1081858236 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11400000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} @@ -677,9 +707,10 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 4 --- !u!1001 &1373034542 Prefab: m_ObjectHideFlags: 0 @@ -689,11 +720,11 @@ Prefab: m_Modifications: - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_LocalPosition.x - value: 3.18000007 + value: 3.18 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_LocalPosition.y - value: -3.1500001 + value: -3.15 objectReference: {fileID: 0} - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_LocalPosition.z @@ -717,7 +748,7 @@ Prefab: objectReference: {fileID: 0} - target: {fileID: 400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_RootOrder - value: 5 + value: 6 objectReference: {fileID: 0} - target: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} propertyPath: m_Name @@ -734,21 +765,6 @@ Prefab: m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_IsPrefabParent: 0 ---- !u!115 &1447151998 -MonoScript: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_Name: - serializedVersion: 4 - m_Script: - m_DefaultReferences: {} - m_Icon: {fileID: 0} - m_ExecutionOrder: 0 - m_ClassName: SetActive - m_Namespace: Fungus - m_AssemblyName: Assembly-CSharp.dll - m_IsEditorScript: 0 --- !u!1 &1597904418 GameObject: m_ObjectHideFlags: 0 @@ -782,7 +798,8 @@ MonoBehaviour: m_SubmitButton: Submit m_CancelButton: Cancel m_InputActionsPerSecond: 10 - m_AllowActivationOnMobileDevice: 0 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 --- !u!114 &1597904420 MonoBehaviour: m_ObjectHideFlags: 0 @@ -806,14 +823,15 @@ Transform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 8 ---- !u!1 &1637100245 + m_RootOrder: 9 +--- !u!1 &1637100245 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} m_PrefabInternal: {fileID: 228925351} ---- !u!114 &1637100246 +--- !u!114 &1637100246 stripped MonoBehaviour: m_PrefabParentObject: {fileID: 11400000, guid: 0e6bcf37a2876432fa58eff8888bf177, type: 2} @@ -845,6 +863,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 2096462795} m_RootOrder: 0 @@ -852,7 +871,7 @@ RectTransform: m_AnchorMax: {x: 1, y: 1} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1966497755 MonoBehaviour: m_ObjectHideFlags: 0 @@ -865,7 +884,13 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: .196078435, g: .196078435, b: .196078435, a: 1} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} m_FontSize: 14 @@ -874,6 +899,7 @@ MonoBehaviour: m_MinSize: 10 m_MaxSize: 40 m_Alignment: 4 + m_AlignByGeometry: 0 m_RichText: 1 m_HorizontalOverflow: 0 m_VerticalOverflow: 0 @@ -899,7 +925,6 @@ GameObject: - 114: {fileID: 2019116683} - 114: {fileID: 2019116680} - 114: {fileID: 2019116669} - - 114: {fileID: 2019116670} - 114: {fileID: 2019116677} - 114: {fileID: 2019116676} - 114: {fileID: 2019116675} @@ -954,7 +979,7 @@ MonoBehaviour: y: -452 width: 1887 height: 1080 - selectedBlock: {fileID: 2019116687} + selectedBlock: {fileID: 2019116698} selectedCommands: [] variables: [] description: 'This scene shows how to set up a drag-and-drop @@ -992,29 +1017,7 @@ MonoBehaviour: eventHandler: {fileID: 2019116681} commandList: - {fileID: 2019116672} - - {fileID: 2019116670} - {fileID: 2019116671} ---- !u!114 &2019116670 -MonoBehaviour: - m_ObjectHideFlags: 2 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 2019116667} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 1447151998} - m_Name: - m_EditorClassIdentifier: - itemId: 0 - errorMessage: - indentLevel: 0 - _targetGameObject: - gameObjectRef: {fileID: 0} - gameObjectVal: {fileID: 1081858233} - activeState: - booleanRef: {fileID: 0} - booleanVal: 0 - targetGameObjectOLD: {fileID: 0} --- !u!114 &2019116671 MonoBehaviour: m_ObjectHideFlags: 2 @@ -1027,7 +1030,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 6 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1047,7 +1049,7 @@ MonoBehaviour: durationOLD: 0 _offset: vector3Ref: {fileID: 0} - vector3Val: {x: .5, y: .5, z: 0} + vector3Val: {x: 0.5, y: 0.5, z: 0} offsetOLD: {x: 0, y: 0, z: 0} --- !u!114 &2019116672 MonoBehaviour: @@ -1061,7 +1063,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 5 - errorMessage: indentLevel: 0 commenterName: commentText: Destroy the dragged object and scale up the target object @@ -1090,7 +1091,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 4 - errorMessage: indentLevel: 0 commenterName: commentText: Decrease scale when drag is cancelled @@ -1106,7 +1106,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 3 - errorMessage: indentLevel: 0 commenterName: commentText: Increase scale when drag starts @@ -1122,7 +1121,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 2 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1132,7 +1130,7 @@ MonoBehaviour: stringVal: _duration: floatRef: {fileID: 0} - floatVal: .100000001 + floatVal: 0.1 easeType: 2 loopType: 0 stopPreviousTweens: 0 @@ -1142,7 +1140,7 @@ MonoBehaviour: durationOLD: 0 _offset: vector3Ref: {fileID: 0} - vector3Val: {x: -.25, y: -.25, z: 0} + vector3Val: {x: -0.25, y: -0.25, z: 0} offsetOLD: {x: 0, y: 0, z: 0} --- !u!114 &2019116677 MonoBehaviour: @@ -1156,7 +1154,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 1 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1166,7 +1163,7 @@ MonoBehaviour: stringVal: _duration: floatRef: {fileID: 0} - floatVal: .100000001 + floatVal: 0.1 easeType: 2 loopType: 0 stopPreviousTweens: 0 @@ -1176,7 +1173,7 @@ MonoBehaviour: durationOLD: 0 _offset: vector3Ref: {fileID: 0} - vector3Val: {x: .25, y: .25, z: 0} + vector3Val: {x: 0.25, y: 0.25, z: 0} offsetOLD: {x: 0, y: 0, z: 0} --- !u!114 &2019116678 MonoBehaviour: @@ -1203,7 +1200,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 10 - errorMessage: indentLevel: 0 commenterName: commentText: Do a punch rotation effect when the dragged object stops touching the @@ -1258,7 +1254,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 9 - errorMessage: indentLevel: 0 commenterName: commentText: Do a punch position effect when the dragged object starts touching @@ -1375,7 +1370,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 11 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1406,11 +1400,12 @@ Transform: m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 2019116667} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1.15999997, y: .340000004, z: 0} + m_LocalPosition: {x: -1.16, y: 0.34, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 7 --- !u!114 &2019116690 MonoBehaviour: m_ObjectHideFlags: 2 @@ -1423,7 +1418,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 7 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1458,7 +1452,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 8 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1552,7 +1545,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 12 - errorMessage: indentLevel: 0 _targetObject: gameObjectRef: {fileID: 0} @@ -1572,7 +1564,7 @@ MonoBehaviour: durationOLD: 0 _amount: vector3Ref: {fileID: 0} - vector3Val: {x: .5, y: .5, z: 0} + vector3Val: {x: 0.5, y: 0.5, z: 0} amountOLD: {x: 0, y: 0, z: 0} --- !u!114 &2019116696 MonoBehaviour: @@ -1599,7 +1591,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: itemId: 21 - errorMessage: indentLevel: 0 cursorTexture: {fileID: 2800000, guid: 502e0c9b755f34db0b90bf78857d8a1c, type: 3} hotSpot: {x: 0, y: 0} @@ -1665,15 +1656,16 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1966497754} m_Father: {fileID: 19757137} m_RootOrder: 1 - m_AnchorMin: {x: .5, y: .5} - m_AnchorMax: {x: .5, y: .5} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} m_AnchoredPosition: {x: -166, y: -157} m_SizeDelta: {x: 185, y: 65} - m_Pivot: {x: .5, y: .5} + m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &2096462796 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1694,11 +1686,11 @@ MonoBehaviour: m_Transition: 1 m_Colors: m_NormalColor: {r: 1, g: 1, b: 1, a: 1} - m_HighlightedColor: {r: .960784316, g: .960784316, b: .960784316, a: 1} - m_PressedColor: {r: .784313738, g: .784313738, b: .784313738, a: 1} - m_DisabledColor: {r: .784313738, g: .784313738, b: .784313738, a: .501960814} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} m_ColorMultiplier: 1 - m_FadeDuration: .100000001 + m_FadeDuration: 0.1 m_SpriteState: m_HighlightedSprite: {fileID: 0} m_PressedSprite: {fileID: 0} @@ -1728,6 +1720,12 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} m_Type: 1 m_PreserveAspect: 0 @@ -1781,6 +1779,10 @@ Prefab: propertyPath: m_RootOrder value: 2 objectReference: {fileID: 0} + - target: {fileID: 11400000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} + propertyPath: hoverCursor + value: + objectReference: {fileID: 2800000, guid: 22eb050bacf8c401ca8503e24bff3570, type: 3} m_RemovedComponents: [] m_ParentPrefab: {fileID: 100100000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} m_IsPrefabParent: 0 diff --git a/Assets/Tests/Narrative/NarrativeTests.unity b/Assets/Tests/Narrative/NarrativeTests.unity index fd769936..6449eaeb 100644 --- a/Assets/Tests/Narrative/NarrativeTests.unity +++ b/Assets/Tests/Narrative/NarrativeTests.unity @@ -117,7 +117,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} m_Name: m_EditorClassIdentifier: - selectedFlowchart: {fileID: 1913435020} + selectedFlowchart: {fileID: 736071350} --- !u!4 &11556238 Transform: m_ObjectHideFlags: 1 @@ -2899,7 +2899,6 @@ MonoBehaviour: nameText: Sherlock nameColor: {r: 1, g: 1, b: 1, a: 1} soundEffect: {fileID: 0} - profileSprite: {fileID: 21300000, guid: 10cc2fec4b8aa4db983981588b06b591, type: 3} portraits: - {fileID: 21300000, guid: 10cc2fec4b8aa4db983981588b06b591, type: 3} - {fileID: 21300000, guid: 450277e404c2d4d1e87c5bd4012283bb, type: 3} @@ -3455,7 +3454,6 @@ MonoBehaviour: nameText: John nameColor: {r: 1, g: 1, b: 1, a: 1} soundEffect: {fileID: 0} - profileSprite: {fileID: 21300000, guid: 820bab66bb5a044ec961ba8ee3b045cc, type: 3} portraits: - {fileID: 21300000, guid: 820bab66bb5a044ec961ba8ee3b045cc, type: 3} - {fileID: 21300000, guid: a92b08a118b7d46f59dd091acb2e4102, type: 3} @@ -3730,7 +3728,6 @@ MonoBehaviour: - {fileID: 297056950} - {fileID: 1049860613} - {fileID: 813974793} - cachedPositions: [] --- !u!1 &499706539 GameObject: m_ObjectHideFlags: 0 @@ -5424,7 +5421,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 1 + m_IsActive: 0 --- !u!4 &685425359 Transform: m_ObjectHideFlags: 0 @@ -6466,26 +6463,9 @@ MonoBehaviour: Culture=neutral, PublicKeyToken=null targetComponentFullname: UnityEngine.Component[] targetComponentText: WriterAudio - targetMethod: SetAudioMode - targetMethodText: 'SetAudioMode (AudioMode): Void' - methodParameters: - - objValue: - typeAssemblyname: Fungus.WriterAudio+AudioMode, Assembly-CSharp, Version=0.0.0.0, - Culture=neutral, PublicKeyToken=null - typeFullname: Fungus.WriterAudio+AudioMode - intValue: 0 - boolValue: 0 - floatValue: 0 - stringValue: - colorValue: {r: 0, g: 0, b: 0, a: 0} - gameObjectValue: {fileID: 0} - materialValue: {fileID: 0} - objectValue: {fileID: 0} - spriteValue: {fileID: 0} - textureValue: {fileID: 0} - vector2Value: {x: 0, y: 0} - vector3Value: {x: 0, y: 0, z: 0} - variableKey: + targetMethod: OnInput + targetMethodText: 'OnInput (): Void' + methodParameters: [] saveReturnValue: 0 returnValueVariableKey: returnValueType: System.Void @@ -7413,7 +7393,6 @@ MonoBehaviour: - {fileID: 1968482742} - {fileID: 1336986580} - {fileID: 1754947673} - cachedPositions: [] --- !u!4 &825247592 Transform: m_ObjectHideFlags: 0 @@ -10356,7 +10335,6 @@ MonoBehaviour: nameText: Somebody nameColor: {r: 0.2352941, g: 0.2352941, b: 0.2352941, a: 1} soundEffect: {fileID: 0} - profileSprite: {fileID: 21300000, guid: 10cc2fec4b8aa4db983981588b06b591, type: 3} portraits: - {fileID: 21300000, guid: 10cc2fec4b8aa4db983981588b06b591, type: 3} portraitsFace: 0 @@ -10477,7 +10455,6 @@ MonoBehaviour: nameText: TestCharacter nameColor: {r: 1, g: 1, b: 1, a: 1} soundEffect: {fileID: 0} - profileSprite: {fileID: 21300000, guid: 5b776e5296df54952a07a367943f5c7c, type: 3} portraits: - {fileID: 21300000, guid: 5b776e5296df54952a07a367943f5c7c, type: 3} - {fileID: 21300000, guid: 820bab66bb5a044ec961ba8ee3b045cc, type: 3} @@ -13702,7 +13679,6 @@ MonoBehaviour: nameText: Character Name nameColor: {r: 1, g: 1, b: 1, a: 1} soundEffect: {fileID: 0} - profileSprite: {fileID: 21300000, guid: 450277e404c2d4d1e87c5bd4012283bb, type: 3} portraits: - {fileID: 21300000, guid: 450277e404c2d4d1e87c5bd4012283bb, type: 3} - {fileID: 21300000, guid: c779e34c6eb8e45da98c70cf2802a54c, type: 3} @@ -17982,7 +17958,6 @@ MonoBehaviour: nameText: Test Character nameColor: {r: 1, g: 1, b: 1, a: 1} soundEffect: {fileID: 8300000, guid: 0cdfebb6349aa4b72a1d34c47935faf8, type: 3} - profileSprite: {fileID: 0} portraits: [] portraitsFace: 0 setSayDialog: {fileID: 0} diff --git a/Assets/Tests/UI/Editor/TextTagParserTests.cs b/Assets/Tests/UI/Editor/TextTagParserTests.cs index 290ec9ab..2e56c821 100644 --- a/Assets/Tests/UI/Editor/TextTagParserTests.cs +++ b/Assets/Tests/UI/Editor/TextTagParserTests.cs @@ -16,10 +16,8 @@ public class TextTagParserTests [Test] public void TextTagParser_Parser() { - var textTagParser = new TextTagParser(); - // Parse an example string, generate correct sequence of tags - List tokens = textTagParser.Tokenize("Words " + + List tokens = TextTagParser.Tokenize("Words " + "{b}bold test{/b}" + "{i}italic test{/i}" + "{color=red}color test{/color}" + @@ -181,10 +179,8 @@ public class TextTagParserTests [Test] public void TextTagParser_AudioWaitBug() { - var textTagParser = new TextTagParser(); - // Parse an example string, generate correct sequence of tags - List tokens = textTagParser.Tokenize("Play sound{audio=BeepSound}{w=1} Play loop{audioloop=BeepSound}{w=3} Stop{audiostop=BeepSound}"); + List tokens = TextTagParser.Tokenize("Play sound{audio=BeepSound}{w=1} Play loop{audioloop=BeepSound}{w=3} Stop{audiostop=BeepSound}"); int i = 0; Assert.That(tokens[i].type == TokenType.Words); diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 9ed24b4d..20dab2a7 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -500,7 +500,44 @@ PlayerSettings: WebGL::emscriptenArgs: WebGL::template: APPLICATION:Default additionalIl2CppArgs::additionalIl2CppArgs: - vectorPropertyNames: [] + vectorPropertyNames: + - Android::VR::enabledDevices + - Metro::VR::enabledDevices + - N3DS::VR::enabledDevices + - PS3::VR::enabledDevices + - PS4::VR::enabledDevices + - PSM::VR::enabledDevices + - PSP2::VR::enabledDevices + - SamsungTV::VR::enabledDevices + - Standalone::VR::enabledDevices + - Tizen::VR::enabledDevices + - WebGL::VR::enabledDevices + - WebPlayer::VR::enabledDevices + - WiiU::VR::enabledDevices + - Xbox360::VR::enabledDevices + - XboxOne::VR::enabledDevices + - iOS::VR::enabledDevices + - tvOS::VR::enabledDevices + Android::VR::enabledDevices: + - Oculus + Metro::VR::enabledDevices: [] + N3DS::VR::enabledDevices: [] + PS3::VR::enabledDevices: [] + PS4::VR::enabledDevices: + - PlayStationVR + PSM::VR::enabledDevices: [] + PSP2::VR::enabledDevices: [] + SamsungTV::VR::enabledDevices: [] + Standalone::VR::enabledDevices: + - Oculus + Tizen::VR::enabledDevices: [] + WebGL::VR::enabledDevices: [] + WebPlayer::VR::enabledDevices: [] + WiiU::VR::enabledDevices: [] + Xbox360::VR::enabledDevices: [] + XboxOne::VR::enabledDevices: [] + iOS::VR::enabledDevices: [] + tvOS::VR::enabledDevices: [] cloudProjectId: projectName: organizationId: