diff --git a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs index 00b9b64a..c3ef4056 100644 --- a/Assets/Fungus/Flowchart/Scripts/Flowchart.cs +++ b/Assets/Fungus/Flowchart/Scripts/Flowchart.cs @@ -24,7 +24,7 @@ namespace Fungus * Flowchart objects may be edited visually using the Flowchart editor window. */ [ExecuteInEditMode] - public class Flowchart : MonoBehaviour + public class Flowchart : MonoBehaviour, StringSubstituter.ISubstitutionHandler { /** * The current version of the Flowchart. Used for updating components. @@ -159,6 +159,8 @@ namespace Fungus protected static bool eventSystemPresent; + protected StringSubstituter stringSubstituer; + /** * Returns the next id to assign to a new flowchart item. * Item ids increase monotically so they are guaranteed to @@ -191,7 +193,7 @@ namespace Fungus { CheckEventSystem(); } - + // There must be an Event System in the scene for Say and Menu input to work. // This method will automatically instantiate one if none exists. protected virtual void CheckEventSystem() @@ -946,64 +948,84 @@ namespace Fungus return executingBlocks; } - public virtual string SubstituteVariables(string text) + /** + * Implementation of StringSubstituter.ISubstitutionHandler which matches any public variable in the Flowchart. + * To perform full variable substitution with all substitution handlers in the scene, you should + * use the SubstituteVariables() method instead. + */ + [MoonSharp.Interpreter.MoonSharpHidden] + public virtual string SubstituteStrings(string input) { - string subbedText = text; - + string subbedText = input; + // Instantiate the regular expression object. Regex r = new Regex("{\\$.*?}"); - + // Match the regular expression pattern against a text string. - var results = r.Matches(text); + var results = r.Matches(input); foreach (Match match in results) { string key = match.Value.Substring(2, match.Value.Length - 3); - // Look for any matching variables in this Flowchart first (public or private) + // Look for any matching public variables in this Flowchart foreach (Variable variable in variables) { if (variable == null) continue; - if (variable.key == key) + if (variable.scope == VariableScope.Public && + variable.key == key) { string value = variable.ToString(); subbedText = subbedText.Replace(match.Value, value); } } + } + + return subbedText; + } + + /** + * 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) + { + stringSubstituer = new StringSubstituter(); + } + + string subbedText = input; + + // Instantiate the regular expression object. + Regex r = new Regex("{\\$.*?}"); + + // Match the regular expression pattern against a text string. + var results = r.Matches(input); + foreach (Match match in results) + { + string key = match.Value.Substring(2, match.Value.Length - 3); - // Now search all public variables in all scene Flowcharts in the scene - foreach (Flowchart flowchart in cachedFlowcharts) + // Look for any matching private variables in this Flowchart first + foreach (Variable variable in variables) { - if (flowchart == this) - { - // We've already searched this flowchart + if (variable == null) continue; - } - foreach (Variable variable in flowchart.variables) - { - if (variable == null) - continue; - - if (variable.scope == VariableScope.Public && - variable.key == key) - { - string value = variable.ToString(); - subbedText = subbedText.Replace(match.Value, value); - } + if (variable.scope == VariableScope.Private && + variable.key == key) + { + string value = variable.ToString(); + subbedText = subbedText.Replace(match.Value, value); } } - - // Next look for matching localized string - string localizedString = Localization.GetLocalizedString(key); - if (localizedString != null) - { - subbedText = subbedText.Replace(match.Value, localizedString); - } } - - return subbedText; + + // Now do all other substitutions in the scene + return stringSubstituer.SubstituteStrings(subbedText); } } diff --git a/Assets/Fungus/Lua/Scripts/LuaUtils.cs b/Assets/Fungus/Lua/Scripts/LuaUtils.cs index 35b9eaef..62ced355 100644 --- a/Assets/Fungus/Lua/Scripts/LuaUtils.cs +++ b/Assets/Fungus/Lua/Scripts/LuaUtils.cs @@ -13,7 +13,7 @@ using MoonSharp.RemoteDebugger; namespace Fungus { - public class LuaUtils : LuaEnvironment.Initializer + public class LuaUtils : LuaEnvironment.Initializer, StringSubstituter.ISubstitutionHandler { /// /// Lua script file which defines the global string table used for localisation. @@ -57,6 +57,8 @@ namespace Fungus /// protected LuaEnvironment luaEnvironment; + protected StringSubstituter stringSubstituter; + /// /// Called by LuaEnvironment when initializing. /// @@ -193,6 +195,8 @@ namespace Fungus LuaEnvironment.LogException(ex.DecoratedMessage, stringTable.text); } } + + stringSubstituter = new StringSubstituter(); } /// @@ -219,32 +223,34 @@ namespace Fungus } /// + /// Implementation of StringSubstituter.ISubstitutionHandler /// Substitutes specially formatted tokens in the text with global variables and string table values. /// The string table value used depends on the currently loaded string table and active language. /// - public virtual string Substitute(string text) + [MoonSharpHidden] + public virtual string SubstituteStrings(string input) { if (luaEnvironment == null) { UnityEngine.Debug.LogError("No Lua Environment found"); - return text; + return input; } if (luaEnvironment.Interpreter == null) { UnityEngine.Debug.LogError("No Lua interpreter found"); - return text; + return input; } MoonSharp.Interpreter.Script interpreter = luaEnvironment.Interpreter; - string subbedText = text; + string subbedText = input; // Instantiate the regular expression object. - Regex r = new Regex("\\[\\$.*?\\]"); + Regex r = new Regex("\\{\\$.*?\\}"); // Match the regular expression pattern against a text string. - var results = r.Matches(text); + var results = r.Matches(input); foreach (Match match in results) { string key = match.Value.Substring(2, match.Value.Length - 3); @@ -276,6 +282,15 @@ namespace Fungus return subbedText; } + /// + /// Performs string substitution on the input string, replacing tokens of the form {$VarName} with + /// matching variables, localised strings, etc. in the scene. + /// + public virtual string Substitute(string input) + { + return stringSubstituter.SubstituteStrings(input); + } + /// /// Returns the time since level load, multiplied by timeScale. /// If timeScale is negative then returns the same as Time.timeSinceLevelLoaded. diff --git a/Assets/Fungus/Lua/Scripts/StringSubstituter.cs b/Assets/Fungus/Lua/Scripts/StringSubstituter.cs new file mode 100644 index 00000000..5d16a89b --- /dev/null +++ b/Assets/Fungus/Lua/Scripts/StringSubstituter.cs @@ -0,0 +1,76 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Fungus +{ + /// + /// Replaces special tokens in a string with substituted values (typically variables or localisation strings). + /// + public class StringSubstituter + { + /// + /// Interface for components that support substituting strings. + /// + public interface ISubstitutionHandler + { + /// + /// Returns a new string with tokens replaced by subsituted values. + /// It's up to clients how to implement substitution but the convention looks like: + /// "Hi {$VarName}" => "Hi John" where VarName == "John" + /// + string SubstituteStrings(string input); + } + + protected List substitutionHandlers = new List(); + + /// + /// Constructor which caches all components in the scene that implement ISubstitutionHandler. + /// + public StringSubstituter() + { + CacheSubstitutionHandlers(); + } + + /// + /// Populates a cache of all components in the scene that implement ISubstitutionHandler. + /// + public virtual void CacheSubstitutionHandlers() + { + // Use reflection to find all components in the scene that implement ISubstitutionHandler + var types = this.GetType().Assembly.GetTypes().Where(type => type.IsClass && + !type.IsAbstract && + typeof(ISubstitutionHandler).IsAssignableFrom(type)); + + substitutionHandlers.Clear(); + foreach (System.Type t in types) + { + Object[] objects = GameObject.FindObjectsOfType(t); + foreach (Object o in objects) + { + ISubstitutionHandler handler = o as ISubstitutionHandler; + if (handler != null) + { + substitutionHandlers.Add(handler); + } + } + } + } + + /// + /// Returns a new string that has been processed by all substitution handlers in the scene. + /// + public virtual string SubstituteStrings(string input) + { + string newString = input; + foreach (ISubstitutionHandler handler in substitutionHandlers) + { + newString = handler.SubstituteStrings(newString); + } + + return newString; + } + } + +} \ No newline at end of file diff --git a/Assets/Fungus/Lua/Scripts/StringSubstituter.cs.meta b/Assets/Fungus/Lua/Scripts/StringSubstituter.cs.meta new file mode 100644 index 00000000..901da373 --- /dev/null +++ b/Assets/Fungus/Lua/Scripts/StringSubstituter.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 32205fac1893a4bbf9e2cb588b1b9dc9 +timeCreated: 1459784535 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Narrative/Scripts/Localization.cs b/Assets/Fungus/Narrative/Scripts/Localization.cs index 6f1c868b..71925de2 100644 --- a/Assets/Fungus/Narrative/Scripts/Localization.cs +++ b/Assets/Fungus/Narrative/Scripts/Localization.cs @@ -5,6 +5,7 @@ using UnityEditor; using System; using System.Collections; using System.Collections.Generic; +using System.Text.RegularExpressions; using System.IO; using Ideafixxxer.CsvParser; @@ -22,7 +23,7 @@ namespace Fungus /** * Multi-language localization support. */ - public class Localization : MonoBehaviour + public class Localization : MonoBehaviour, StringSubstituter.ISubstitutionHandler { /** * Language to use at startup, usually defined by a two letter language code (e.g DE = German) @@ -56,6 +57,8 @@ namespace Fungus [NonSerialized] public string notificationText = ""; + protected bool initialized; + public virtual void OnLevelWasLoaded(int level) { // Check if a language has been selected using the Set Language command in a previous scene. @@ -68,13 +71,29 @@ namespace Fungus public virtual void Start() { + Init(); + } + + /** + * String subsitution can happen during the Start of another component, so we + * may need to call Init() from other methods. + */ + protected virtual void Init() + { + if (initialized) + { + return; + } + CacheLocalizeableObjects(); if (localizationFile != null && - localizationFile.text.Length > 0) + localizationFile.text.Length > 0) { SetActiveLanguage(activeLanguage); } + + initialized = true; } public virtual void ClearLocalizeableCache() @@ -487,6 +506,38 @@ namespace Fungus notificationText = "Updated " + updatedCount + " standard text items."; } + + /** + * Implementation of StringSubstituter.ISubstitutionHandler. + * Relaces tokens of the form {$KeyName} with the localized value corresponding to that key. + */ + public virtual string SubstituteStrings(string input) + { + // This method could be called from the Start method of another component, so we + // may need to initilize the localization system. + Init(); + + string subbedText = input; + + // Instantiate the regular expression object. + Regex r = new Regex("{\\$.*?}"); + + // Match the regular expression pattern against a text string. + var results = r.Matches(input); + foreach (Match match in results) + { + string key = match.Value.Substring(2, match.Value.Length - 3); + + // Next look for matching localized string + string localizedString = Localization.GetLocalizedString(key); + if (localizedString != null) + { + subbedText = subbedText.Replace(match.Value, localizedString); + } + } + + return subbedText; + } } } \ No newline at end of file diff --git a/Assets/Tests/StringSubstitution.meta b/Assets/Tests/StringSubstitution.meta new file mode 100644 index 00000000..88da87d0 --- /dev/null +++ b/Assets/Tests/StringSubstitution.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1e9c64a0b75ad4f8fa20114b171c5553 +folderAsset: yes +timeCreated: 1459849429 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity b/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity new file mode 100644 index 00000000..fbc4e530 --- /dev/null +++ b/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity @@ -0,0 +1,1745 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +SceneSettings: + m_ObjectHideFlags: 0 + m_PVSData: + m_PVSObjectsArray: [] + m_PVSPortalsArray: [] + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 6 + m_GIWorkflowMode: 1 + m_LightmapsMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 3 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AOMaxDistance: 1 + m_Padding: 2 + m_CompAOExponent: 0 + m_LightmapParameters: {fileID: 0} + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherRayCount: 1024 + m_ReflectionCompression: 2 + m_LightingDataAsset: {fileID: 0} + m_RuntimeCPUUsage: 25 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + accuratePlacement: 0 + minRegionArea: 2 + cellSize: 0.16666667 + manualCellSize: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &32012239 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 32012240} + - 114: {fileID: 32012242} + - 114: {fileID: 32012241} + m_Layer: 0 + m_Name: LuaEnvironment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &32012240 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 32012239} + 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_Children: [] + m_Father: {fileID: 982964957} + m_RootOrder: 0 +--- !u!114 &32012241 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 32012239} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} + m_Name: + m_EditorClassIdentifier: + stringTable: {fileID: 4900000, guid: 9900570d789fa4b29957e4b897af9e3b, type: 3} + activeLanguage: en + timeScale: -1 + registerTypes: + - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} +--- !u!114 &32012242 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 32012239} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} + m_Name: + m_EditorClassIdentifier: + remoteDebugger: 0 +--- !u!1 &35396879 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 149266, guid: ffbd0831d997545eab75c364da082c1b, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 35396880} + - 114: {fileID: 35396881} + m_Layer: 0 + m_Name: Localization + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &35396880 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 480768, guid: ffbd0831d997545eab75c364da082c1b, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 35396879} + 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_Children: [] + m_Father: {fileID: 1627631718} + m_RootOrder: 0 +--- !u!114 &35396881 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11438504, guid: ffbd0831d997545eab75c364da082c1b, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 35396879} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e5724422a635e425bae0af9ffe2615d6, type: 3} + m_Name: + m_EditorClassIdentifier: + activeLanguage: + localizationFile: {fileID: 4900000, guid: f4a19faae37354696ad9363ee85617eb, type: 3} +--- !u!1 &99724762 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 99724764} + - 114: {fileID: 99724763} + m_Layer: 0 + m_Name: TestRunner + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &99724763 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 99724762} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5c3afc1c624179749bcdecf7b0224902, type: 3} + m_Name: + m_EditorClassIdentifier: + currentTest: {fileID: 0} +--- !u!4 &99724764 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 99724762} + 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_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 +--- !u!1 &167744853 +GameObject: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 167744855} + - 114: {fileID: 167744854} + m_Layer: 0 + m_Name: _FungusState + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &167744854 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 167744853} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3} + m_Name: + m_EditorClassIdentifier: + selectedFlowchart: {fileID: 875535388} +--- !u!4 &167744855 +Transform: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 167744853} + 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_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 +--- !u!1 &530598961 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 139298, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 530598962} + - 114: {fileID: 530598963} + m_Layer: 0 + m_Name: LuaScript + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &530598962 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 530598961} + 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_Children: [] + m_Father: {fileID: 1627631718} + m_RootOrder: 1 +--- !u!114 &530598963 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11472914, guid: c356764ac08ce4af2806a601a4f1e6e9, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 530598961} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + luaEnvironment: {fileID: 0} + luaFile: {fileID: 0} + luaScript: 'local subbed = "" + + + -- Test localisation value subsitution + + subbed = fungus.sub("{$SETTEXT.Flowchart.6}") + + print (subbed) + + fungus.assert (subbed == "English text") + + + fungus.pass() + +' + runAsCoroutine: 1 + useFungusModule: 1 +--- !u!1 &545923887 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 545923889} + - 114: {fileID: 545923888} + m_Layer: 0 + m_Name: WriteTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &545923888 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 545923887} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 5 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 0 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: +--- !u!4 &545923889 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 545923887} + 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_Children: + - {fileID: 2035584479} + - {fileID: 875535383} + - {fileID: 1818190874} + - {fileID: 1106846133} + - {fileID: 1373360854} + - {fileID: 701857887} + m_Father: {fileID: 0} + m_RootOrder: 7 +--- !u!1 &567521726 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 567521730} + - 114: {fileID: 567521729} + - 114: {fileID: 567521728} + - 114: {fileID: 567521727} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &567521727 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 567521726} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1997211142, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ForceModuleActive: 0 +--- !u!114 &567521728 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 567521726} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &567521729 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 567521726} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &567521730 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 567521726} + 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_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 +--- !u!1 &684307462 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 684307464} + - 114: {fileID: 684307463} + m_Layer: 0 + m_Name: FlowchartTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!114 &684307463 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 684307462} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 5 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 0 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: +--- !u!4 &684307464 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 684307462} + 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_Children: + - {fileID: 951347108} + - {fileID: 1563984263} + - {fileID: 1633325651} + - {fileID: 1380821995} + m_Father: {fileID: 0} + m_RootOrder: 5 +--- !u!1 &695468074 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 695468075} + - 114: {fileID: 695468077} + - 114: {fileID: 695468076} + m_Layer: 0 + m_Name: LuaEnvironment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &695468075 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 695468074} + 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_Children: [] + m_Father: {fileID: 1627631718} + m_RootOrder: 2 +--- !u!114 &695468076 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 695468074} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} + m_Name: + m_EditorClassIdentifier: + stringTable: {fileID: 0} + activeLanguage: en + timeScale: -1 + registerTypes: + - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} +--- !u!114 &695468077 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 695468074} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} + m_Name: + m_EditorClassIdentifier: + remoteDebugger: 0 +--- !u!1 &701857886 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 178698, guid: e0c2b90c058ff43f4a56a266d4fa721b, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 701857887} + - 114: {fileID: 701857888} + m_Layer: 0 + m_Name: LuaBindings + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &701857887 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 403334, guid: e0c2b90c058ff43f4a56a266d4fa721b, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 701857886} + 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_Children: [] + m_Father: {fileID: 545923889} + m_RootOrder: 5 +--- !u!114 &701857888 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11414792, guid: e0c2b90c058ff43f4a56a266d4fa721b, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 701857886} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4cc8a659e950044b69d7c62696c36962, type: 3} + m_Name: + m_EditorClassIdentifier: + tableName: + registerTypes: 1 + boundTypes: + - UnityEngine.GameObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.PrimitiveType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Component, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - UnityEngine.SendMessageOptions, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + - UnityEngine.SceneManagement.Scene, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + - UnityEngine.Object, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - UnityEngine.UI.Text, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.TextGenerator, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Texture, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Font, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.TextAnchor, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.HorizontalWrapMode, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + - UnityEngine.VerticalWrapMode, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.FontStyle, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.TextGenerationSettings, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + - UnityEngine.Vector2, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + boundObjects: + - key: text + obj: {fileID: 1532141878} + component: {fileID: 1532141880} +--- !u!1 &875535382 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 875535383} + - 114: {fileID: 875535388} + - 114: {fileID: 875535387} + - 114: {fileID: 875535386} + - 114: {fileID: 875535385} + - 114: {fileID: 875535384} + - 114: {fileID: 875535389} + - 114: {fileID: 875535390} + m_Layer: 0 + m_Name: FlowchartA + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &875535383 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875535382} + 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_Children: [] + m_Father: {fileID: 545923889} + m_RootOrder: 1 +--- !u!114 &875535384 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875535382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: StringVarA + value: A +--- !u!114 &875535385 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875535382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ad2261dbe44de43a980e6f7c77c88f7f, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 1 + errorMessage: + indentLevel: 0 + textObject: {fileID: 1532141878} + text: + stringRef: {fileID: 0} + stringVal: '{$StringVarA}{$StringVarB}{$globalvar}' + description: + clearText: 1 + waitUntilFinished: 1 + textColor: 0 + setAlpha: + floatRef: {fileID: 0} + floatVal: 1 + setColor: + colorRef: {fileID: 0} + colorVal: {r: 1, g: 1, b: 1, a: 1} +--- !u!114 &875535386 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11462346, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875535382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3} + m_Name: + m_EditorClassIdentifier: + parentBlock: {fileID: 875535387} +--- !u!114 &875535387 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 11433304, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875535382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3} + m_Name: + m_EditorClassIdentifier: + nodeRect: + serializedVersion: 2 + x: 68 + y: 70 + width: 120 + height: 40 + itemId: 0 + blockName: Start + description: + eventHandler: {fileID: 875535386} + commandList: + - {fileID: 875535390} + - {fileID: 875535389} + - {fileID: 875535385} +--- !u!114 &875535388 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875535382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlock: {fileID: 875535387} + selectedCommands: [] + variables: + - {fileID: 875535384} + description: 'Test substituting variables in a Write command. + + 1. Private variable in this Flowchart. + + 2. Public variable in another Flowchart. + + 3. Global variable in a LuaEnvironment + +' + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] +--- !u!114 &875535389 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875535382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3315ad2ebb85443909a1203d56d9344e, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 2 + errorMessage: + indentLevel: 0 + _duration: + floatRef: {fileID: 0} + floatVal: 0.1 + durationOLD: 0 +--- !u!114 &875535390 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 875535382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ea6e8f632db87477eb750446b28d73a3, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 3 + errorMessage: + indentLevel: 0 + commenterName: + commentText: Wait a little to ensure the LuaScript has executed +--- !u!1 &951347107 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 951347108} + - 114: {fileID: 951347112} + - 114: {fileID: 951347109} + m_Layer: 0 + m_Name: FlowchartA + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &951347108 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 951347107} + 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_Children: [] + m_Father: {fileID: 684307464} + m_RootOrder: 0 +--- !u!114 &951347109 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 951347107} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 0 + key: StringVarA + value: Ok +--- !u!114 &951347112 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 951347107} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlock: {fileID: 0} + selectedCommands: [] + variables: + - {fileID: 951347109} + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] +--- !u!1 &982964955 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 982964957} + - 114: {fileID: 982964956} + m_Layer: 0 + m_Name: LuaTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!114 &982964956 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 982964955} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 5 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 0 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: +--- !u!4 &982964957 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 982964955} + 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_Children: + - {fileID: 32012240} + - {fileID: 1546173554} + m_Father: {fileID: 0} + m_RootOrder: 2 +--- !u!1 &1106846132 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1106846133} + - 223: {fileID: 1106846136} + - 114: {fileID: 1106846135} + - 114: {fileID: 1106846134} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1106846133 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1106846132} + 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_Children: + - {fileID: 1532141879} + m_Father: {fileID: 545923889} + m_RootOrder: 3 + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!114 &1106846134 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1106846132} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1106846135 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1106846132} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &1106846136 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1106846132} + m_Enabled: 1 + serializedVersion: 2 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!1 &1373360853 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1373360854} + - 114: {fileID: 1373360856} + - 114: {fileID: 1373360855} + m_Layer: 0 + m_Name: LuaEnvironment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1373360854 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1373360853} + 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_Children: [] + m_Father: {fileID: 545923889} + m_RootOrder: 4 +--- !u!114 &1373360855 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1373360853} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} + m_Name: + m_EditorClassIdentifier: + stringTable: {fileID: 0} + activeLanguage: en + timeScale: -1 + registerTypes: + - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} +--- !u!114 &1373360856 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1373360853} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} + m_Name: + m_EditorClassIdentifier: + remoteDebugger: 0 +--- !u!1 &1380821994 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 139298, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1380821995} + - 114: {fileID: 1380821996} + m_Layer: 0 + m_Name: LuaScript + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1380821995 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1380821994} + 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_Children: [] + m_Father: {fileID: 684307464} + m_RootOrder: 3 +--- !u!114 &1380821996 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11472914, guid: c356764ac08ce4af2806a601a4f1e6e9, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1380821994} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + luaEnvironment: {fileID: 0} + luaFile: {fileID: 0} + luaScript: 'local subbed = "" + + + -- Private variable should not substitute + + subbed = fungus.sub("{$StringVarA}") + + fungus.assert(subbed == "{$StringVarA}") + + + -- Public variable should substitute + + subbed = fungus.sub("{$StringVarB}") + + fungus.assert (subbed == "Ok") + + + fungus.pass()' + runAsCoroutine: 1 + useFungusModule: 1 +--- !u!1 &1532141878 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 224: {fileID: 1532141879} + - 222: {fileID: 1532141881} + - 114: {fileID: 1532141880} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1532141879 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1532141878} + 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_Children: [] + m_Father: {fileID: 1106846133} + m_RootOrder: 0 + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 30, y: 0} + m_SizeDelta: {x: 199, y: 63} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1532141880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1532141878} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + 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_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 30 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 3 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: New Text +--- !u!222 &1532141881 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1532141878} +--- !u!1 &1546173553 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 139298, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1546173554} + - 114: {fileID: 1546173555} + m_Layer: 0 + m_Name: LuaScript + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1546173554 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1546173553} + 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_Children: [] + m_Father: {fileID: 982964957} + m_RootOrder: 1 +--- !u!114 &1546173555 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11472914, guid: c356764ac08ce4af2806a601a4f1e6e9, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1546173553} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + luaEnvironment: {fileID: 0} + luaFile: {fileID: 0} + luaScript: "local subbed = \"\"\n\n-- Test global variable subsitution\nglobalname + = \"Fred\"\nsubbed = fungus.sub(\"{$globalname}\")\nfungus.assert (subbed == \"Fred\")\n\n-- + Test English string table entry\nsubbed = fungus.sub(\"{$hello}\")\nfungus.assert(subbed + == \"Hi there\")\n\n-- Test French string table entry\nfungus.setlanguage(\"fr\")\nsubbed + = fungus.sub(\"{$hello}\")\nfungus.assert(subbed == \"Bonjour\")\n\n-- Global + \n\nfungus.pass()\n" + runAsCoroutine: 1 + useFungusModule: 1 +--- !u!1 &1563984262 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1563984263} + - 114: {fileID: 1563984266} + - 114: {fileID: 1563984264} + m_Layer: 0 + m_Name: FlowchartB + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1563984263 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1563984262} + 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_Children: [] + m_Father: {fileID: 684307464} + m_RootOrder: 1 +--- !u!114 &1563984264 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1563984262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 1 + key: StringVarB + value: Ok +--- !u!114 &1563984266 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1563984262} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlock: {fileID: 0} + selectedCommands: [] + variables: + - {fileID: 1563984264} + description: + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] +--- !u!1 &1627631716 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1627631718} + - 114: {fileID: 1627631717} + m_Layer: 0 + m_Name: LocalisationTest + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!114 &1627631717 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1627631716} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b1dba0b27b0864740a8720e920aa88c0, type: 3} + m_Name: + m_EditorClassIdentifier: + timeout: 5 + ignored: 0 + succeedAfterAllAssertionsAreExecuted: 0 + expectException: 0 + expectedExceptionList: + succeedWhenExceptionIsThrown: 0 + includedPlatforms: -1 + platformsToIgnore: [] + dynamic: 0 + dynamicTypeName: +--- !u!4 &1627631718 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1627631716} + 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_Children: + - {fileID: 35396880} + - {fileID: 530598962} + - {fileID: 695468075} + m_Father: {fileID: 0} + m_RootOrder: 4 +--- !u!1 &1633325650 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 100640, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1633325651} + - 114: {fileID: 1633325653} + - 114: {fileID: 1633325652} + m_Layer: 0 + m_Name: LuaEnvironment + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1633325651 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1633325650} + 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_Children: [] + m_Father: {fileID: 684307464} + m_RootOrder: 2 +--- !u!114 &1633325652 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1633325650} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c10f0b861365b42b0928858f7b086ff3, type: 3} + m_Name: + m_EditorClassIdentifier: + stringTable: {fileID: 0} + activeLanguage: en + timeScale: -1 + registerTypes: + - {fileID: 4900000, guid: 9c3ab7a98d51241bbb499643399fa761, type: 3} +--- !u!114 &1633325653 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11493126, guid: 49031c561e16d4fcf91c12153f8e0b25, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1633325650} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ba19c26c1ba7243d2b57ebc4329cc7c6, type: 3} + m_Name: + m_EditorClassIdentifier: + remoteDebugger: 0 +--- !u!1 &1818190873 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 142980, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1818190874} + - 114: {fileID: 1818190880} + - 114: {fileID: 1818190876} + m_Layer: 0 + m_Name: FlowchartB + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1818190874 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 467082, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1818190873} + 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_Children: [] + m_Father: {fileID: 545923889} + m_RootOrder: 2 +--- !u!114 &1818190876 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1818190873} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3} + m_Name: + m_EditorClassIdentifier: + scope: 1 + key: StringVarB + value: B +--- !u!114 &1818190880 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11430050, guid: 5e7fbc8d4eb714b279eeeef2262c1e1a, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1818190873} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7a334fe2ffb574b3583ff3b18b4792d3, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 1 + scrollPos: {x: 0, y: 0} + variablesScrollPos: {x: 0, y: 0} + variablesExpanded: 1 + blockViewHeight: 400 + zoom: 1 + scrollViewRect: + serializedVersion: 2 + x: -343 + y: -340 + width: 1114 + height: 859 + selectedBlock: {fileID: 0} + selectedCommands: [] + variables: + - {fileID: 1818190876} + description: 'Test substituting variables in a Write command. + + One variable is a private variable in this Flowchart. + + The other variable is a global variable in a LuaEnvironment' + stepPause: 0 + colorCommands: 1 + hideComponents: 1 + saveSelection: 1 + localizationId: + showLineNumbers: 0 + hideCommands: [] +--- !u!1 &2035584478 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 139298, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 2035584479} + - 114: {fileID: 2035584480} + m_Layer: 0 + m_Name: LuaScript + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2035584479 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 449874, guid: c356764ac08ce4af2806a601a4f1e6e9, type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2035584478} + 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_Children: [] + m_Father: {fileID: 545923889} + m_RootOrder: 0 +--- !u!114 &2035584480 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 11472914, guid: c356764ac08ce4af2806a601a4f1e6e9, + type: 2} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2035584478} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 446caeace65234baaacd52095d24f101, type: 3} + m_Name: + m_EditorClassIdentifier: + executeAfterTime: 1 + repeatExecuteTime: 1 + repeatEveryTime: 1 + executeAfterFrames: 1 + repeatExecuteFrame: 1 + repeatEveryFrame: 1 + hasFailed: 0 + executeMethods: 2 + luaEnvironment: {fileID: 0} + luaFile: {fileID: 0} + luaScript: 'globalvar="C" + + + -- Wait for the Write command to complete + + fungus.wait(0.5) + + + fungus.assert(text.text == "ABC") + + + fungus.pass()' + runAsCoroutine: 1 + useFungusModule: 1 +--- !u!1 &2135590527 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 2135590532} + - 20: {fileID: 2135590531} + - 92: {fileID: 2135590530} + - 124: {fileID: 2135590529} + - 81: {fileID: 2135590528} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &2135590528 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2135590527} + m_Enabled: 1 +--- !u!124 &2135590529 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2135590527} + m_Enabled: 1 +--- !u!92 &2135590530 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2135590527} + m_Enabled: 1 +--- !u!20 &2135590531 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2135590527} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + 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: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!4 &2135590532 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2135590527} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 diff --git a/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity.meta b/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity.meta new file mode 100644 index 00000000..c0ffa5bb --- /dev/null +++ b/Assets/Tests/StringSubstitution/StringSubstitutionTests.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 36de0a0b13ca44b54a426afd535261ea +timeCreated: 1459849440 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/Localisation/CSV.meta b/Assets/Tests/TestAssets/CSV.meta similarity index 100% rename from Assets/Tests/Localisation/CSV.meta rename to Assets/Tests/TestAssets/CSV.meta diff --git a/Assets/Tests/Localisation/CSV/localization_Commands.csv b/Assets/Tests/TestAssets/CSV/localization_Commands.csv similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_Commands.csv rename to Assets/Tests/TestAssets/CSV/localization_Commands.csv diff --git a/Assets/Tests/Localisation/CSV/localization_Commands.csv.meta b/Assets/Tests/TestAssets/CSV/localization_Commands.csv.meta similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_Commands.csv.meta rename to Assets/Tests/TestAssets/CSV/localization_Commands.csv.meta diff --git a/Assets/Tests/Localisation/CSV/localization_Mac.csv b/Assets/Tests/TestAssets/CSV/localization_Mac.csv similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_Mac.csv rename to Assets/Tests/TestAssets/CSV/localization_Mac.csv diff --git a/Assets/Tests/Localisation/CSV/localization_Mac.csv.meta b/Assets/Tests/TestAssets/CSV/localization_Mac.csv.meta similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_Mac.csv.meta rename to Assets/Tests/TestAssets/CSV/localization_Mac.csv.meta diff --git a/Assets/Tests/Localisation/CSV/localization_Narrative.csv b/Assets/Tests/TestAssets/CSV/localization_Narrative.csv similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_Narrative.csv rename to Assets/Tests/TestAssets/CSV/localization_Narrative.csv diff --git a/Assets/Tests/Localisation/CSV/localization_Narrative.csv.meta b/Assets/Tests/TestAssets/CSV/localization_Narrative.csv.meta similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_Narrative.csv.meta rename to Assets/Tests/TestAssets/CSV/localization_Narrative.csv.meta diff --git a/Assets/Tests/Localisation/CSV/localization_Windows.csv b/Assets/Tests/TestAssets/CSV/localization_Windows.csv similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_Windows.csv rename to Assets/Tests/TestAssets/CSV/localization_Windows.csv diff --git a/Assets/Tests/Localisation/CSV/localization_Windows.csv.meta b/Assets/Tests/TestAssets/CSV/localization_Windows.csv.meta similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_Windows.csv.meta rename to Assets/Tests/TestAssets/CSV/localization_Windows.csv.meta diff --git a/Assets/Tests/Localisation/CSV/localization_dottest.csv b/Assets/Tests/TestAssets/CSV/localization_dottest.csv similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_dottest.csv rename to Assets/Tests/TestAssets/CSV/localization_dottest.csv diff --git a/Assets/Tests/Localisation/CSV/localization_dottest.csv.meta b/Assets/Tests/TestAssets/CSV/localization_dottest.csv.meta similarity index 100% rename from Assets/Tests/Localisation/CSV/localization_dottest.csv.meta rename to Assets/Tests/TestAssets/CSV/localization_dottest.csv.meta