Browse Source

Merge pull request #1 from snozbot/master

Would like an update to my fork
master
CG-Tespy 5 years ago committed by GitHub
parent
commit
b95afad6ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 36
      .vscode/launch.json
  2. 57
      .vscode/settings.json
  3. 0
      Assets/Fungus/EditorResources/FungusEditorResources.asset
  4. 15
      Assets/Fungus/Fungus.asmdef
  5. 7
      Assets/Fungus/Fungus.asmdef.meta
  6. 20
      Assets/Fungus/Scripts/Commands/Call.cs
  7. 42
      Assets/Fungus/Scripts/Commands/DebugBreak.cs
  8. 11
      Assets/Fungus/Scripts/Commands/DebugBreak.cs.meta
  9. 12
      Assets/Fungus/Scripts/Commands/Menu.cs
  10. 12
      Assets/Fungus/Scripts/Commands/MenuTimer.cs
  11. 14
      Assets/Fungus/Scripts/Commands/StopBlock.cs
  12. 29
      Assets/Fungus/Scripts/Components/Block.cs
  13. 17
      Assets/Fungus/Scripts/Components/Command.cs
  14. 8
      Assets/Fungus/Scripts/Components/EventHandler.cs
  15. 13
      Assets/Fungus/Scripts/Components/Flowchart.cs
  16. 12
      Assets/Fungus/Scripts/Components/MenuDialog.cs
  17. 11
      Assets/Fungus/Scripts/Components/Variable.cs
  18. 21
      Assets/Fungus/Scripts/Components/Writer.cs
  19. 45
      Assets/Fungus/Scripts/Editor/BlockEditor.cs
  20. 8
      Assets/Fungus/Scripts/Editor/BlockInspector.cs
  21. 4
      Assets/Fungus/Scripts/Editor/CharacterEditor.cs
  22. 73
      Assets/Fungus/Scripts/Editor/CommandListAdaptor.cs
  23. 29
      Assets/Fungus/Scripts/Editor/EditorExtensions.cs
  24. 118
      Assets/Fungus/Scripts/Editor/FlowchartWindow.cs
  25. 17
      Assets/Fungus/Scripts/Editor/FungusEditor.asmdef
  26. 7
      Assets/Fungus/Scripts/Editor/FungusEditor.asmdef.meta
  27. 52
      Assets/Fungus/Scripts/Editor/FungusEditorPreferences.cs
  28. 17
      Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs
  29. 11
      Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs.meta
  30. 28
      Assets/Fungus/Scripts/Editor/PopupContent/VariableSelectPopupWindowContent.cs
  31. 68
      Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs
  32. 10
      Assets/Fungus/Scripts/Interfaces/IBlockCaller.cs
  33. 11
      Assets/Fungus/Scripts/Interfaces/IBlockCaller.cs.meta
  34. 11
      Assets/Fungus/Scripts/Interfaces/IStringLocationIdentifier.cs
  35. 11
      Assets/Fungus/Scripts/Interfaces/IStringLocationIdentifier.cs.meta
  36. 10
      Assets/Fungus/Scripts/Interfaces/IVariableReference.cs
  37. 11
      Assets/Fungus/Scripts/Interfaces/IVariableReference.cs.meta
  38. 3
      Assets/Fungus/Scripts/Utils/BlockReference.cs
  39. 3
      Assets/Fungus/Scripts/Utils/VariableReference.cs
  40. 17
      Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/Fungus.FungusLuaEditor.asmdef
  41. 7
      Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/Fungus.FungusLuaEditor.asmdef.meta
  42. 17
      Assets/Fungus/Thirdparty/LineEndings/Editor/Fungus.LineEndingsEditor.asmdef
  43. 7
      Assets/Fungus/Thirdparty/LineEndings/Editor/Fungus.LineEndingsEditor.asmdef.meta
  44. 17
      Assets/Fungus/Thirdparty/Usfxr/Editor/Fungus.UsfxrEditor.asmdef
  45. 7
      Assets/Fungus/Thirdparty/Usfxr/Editor/Fungus.UsfxrEditor.asmdef.meta
  46. 14
      Assets/FungusExamples/FungusExamples.asmdef
  47. 7
      Assets/FungusExamples/FungusExamples.asmdef.meta
  48. 486
      Assets/FungusExamples/TextMeshPro/TMpro Demo.unity
  49. 8
      Assets/Tests.meta
  50. 8
      Assets/Tests/Editor.meta
  51. 69
      Assets/Tests/Editor/FungusConversationParseTests.cs
  52. 11
      Assets/Tests/Editor/FungusConversationParseTests.cs.meta
  53. 89
      Assets/Tests/Editor/FungusPrioritySignalsTest.cs
  54. 13
      Assets/Tests/Editor/FungusPrioritySignalsTest.cs.meta
  55. 114
      Assets/Tests/Editor/FungusTextVariationSelectionTests.cs
  56. 11
      Assets/Tests/Editor/FungusTextVariationSelectionTests.cs.meta
  57. 73
      Assets/Tests/Editor/GenerateEverythingMenuItem.cs
  58. 11
      Assets/Tests/Editor/GenerateEverythingMenuItem.cs.meta
  59. 220
      Assets/Tests/Editor/TextTagParserTests.cs
  60. 12
      Assets/Tests/Editor/TextTagParserTests.cs.meta
  61. 6062
      Assets/Tests/Everything.unity
  62. 7
      Assets/Tests/Everything.unity.meta
  63. 20392
      Assets/Tests/ManyBlocks_700+.unity
  64. 7
      Assets/Tests/ManyBlocks_700+.unity.meta
  65. 891
      Assets/Tests/SearchableCommands.unity
  66. 7
      Assets/Tests/SearchableCommands.unity.meta
  67. 470
      Assets/Tests/WritingSpeedTest.unity
  68. 7
      Assets/Tests/WritingSpeedTest.unity.meta
  69. 9
      CONTRIBUTING.md
  70. 16
      Logs/Packages-Update.log
  71. 15
      Packages/manifest.json
  72. 4
      ProjectSettings/ProjectVersion.txt
  73. 22
      README.md

36
.vscode/launch.json vendored

@ -1,36 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Unity Editor",
"type": "unity",
"request": "launch"
},
{
"name": "Windows Player",
"type": "unity",
"request": "launch"
},
{
"name": "OSX Player",
"type": "unity",
"request": "launch"
},
{
"name": "Linux Player",
"type": "unity",
"request": "launch"
},
{
"name": "iOS Player",
"type": "unity",
"request": "launch"
},
{
"name": "Android Player",
"type": "unity",
"request": "launch"
}
]
}

57
.vscode/settings.json vendored

@ -1,57 +0,0 @@
{
"files.exclude":
{
"**/.DS_Store":true,
"**/.git":true,
"**/.gitignore":true,
"**/.gitattributes":true,
"**/.gitmodules":true,
"**/.svn":true,
"**/*.booproj":true,
"**/*.pidb":true,
"**/*.suo":true,
"**/*.user":true,
"**/*.userprefs":true,
"**/*.unityproj":true,
"**/*.dll":true,
"**/*.exe":true,
"**/*.pdf":true,
"**/*.mid":true,
"**/*.midi":true,
"**/*.wav":true,
"**/*.gif":true,
"**/*.ico":true,
"**/*.jpg":true,
"**/*.jpeg":true,
"**/*.png":true,
"**/*.psd":true,
"**/*.tga":true,
"**/*.tif":true,
"**/*.tiff":true,
"**/*.3ds":true,
"**/*.3DS":true,
"**/*.fbx":true,
"**/*.FBX":true,
"**/*.lxo":true,
"**/*.LXO":true,
"**/*.ma":true,
"**/*.MA":true,
"**/*.obj":true,
"**/*.OBJ":true,
"**/*.asset":true,
"**/*.cubemap":true,
"**/*.flare":true,
"**/*.mat":true,
"**/*.meta":true,
"**/*.prefab":true,
"**/*.unity":true,
"build/":true,
"Build/":true,
"Library/":true,
"library/":true,
"obj/":true,
"Obj/":true,
"ProjectSettings/":true, "temp/":true,
"Temp/":true
}
}

0
Assets/Fungus/EditorResources/FungusEditorResources.asset

15
Assets/Fungus/Fungus.asmdef

@ -0,0 +1,15 @@
{
"name": "Fungus",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f"
],
"optionalUnityReferences": [],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}

7
Assets/Fungus/Fungus.asmdef.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 007db7f7a4c8f944990d71603a110f82
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

20
Assets/Fungus/Scripts/Commands/Call.cs

@ -30,7 +30,7 @@ namespace Fungus
"Call",
"Execute another block in the same Flowchart as the command, or in a different Flowchart.")]
[AddComponentMenu("")]
public class Call : Command
public class Call : Command, IBlockCaller
{
[Tooltip("Flowchart which contains the block to execute. If none is specified then the current Flowchart is used.")]
[SerializeField] protected Flowchart targetFlowchart;
@ -77,7 +77,6 @@ namespace Fungus
if (callMode == CallMode.WaitUntilFinished)
{
onComplete = delegate {
flowchart.SelectedBlock = ParentBlock;
Continue();
};
}
@ -96,13 +95,6 @@ namespace Fungus
if (targetFlowchart == null ||
targetFlowchart.Equals(GetFlowchart()))
{
// If the executing block is currently selected then follow the execution
// onto the next block in the inspector.
if (flowchart.SelectedBlock == ParentBlock)
{
flowchart.SelectedBlock = targetBlock;
}
if (callMode == CallMode.StopThenCall)
{
StopParentBlock();
@ -166,6 +158,16 @@ namespace Fungus
return startLabel.stringRef == variable || base.HasReference(variable);
}
public bool MayCallBlock(Block block)
{
return block == targetBlock;
}
public string GetLocationIdentifier()
{
return ParentBlock.GetFlowchart().GetName() + ":" + ParentBlock.BlockName + ".Call:" + CommandIndex.ToString();
}
#endregion
}
}

42
Assets/Fungus/Scripts/Commands/DebugBreak.cs

@ -0,0 +1,42 @@
// 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
{
/// <summary>
/// Writes a log message to the debug console.
/// </summary>
[CommandInfo("Scripting",
"Debug Break",
"Calls Debug.Break if enabled. Also useful for putting a visual studio breakbpoint within.")]
[AddComponentMenu("")]
public class DebugBreak : Command
{
[SerializeField] new protected BooleanData enabled = new BooleanData(true);
public override void OnEnter()
{
if (enabled.Value)
Debug.Break();
Continue();
}
public override string GetSummary()
{
return enabled.Value ? "enabled" : "disabled";
}
public override bool HasReference(Variable variable)
{
return variable == enabled.booleanRef;
}
public override Color GetButtonColor()
{
return new Color32(235, 191, 217, 255);
}
}
}

11
Assets/Fungus/Scripts/Commands/DebugBreak.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a14b04da97ec217478d0809feef89ec8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

12
Assets/Fungus/Scripts/Commands/Menu.cs

@ -14,7 +14,7 @@ namespace Fungus
"Menu",
"Displays a button in a multiple choice menu")]
[AddComponentMenu("")]
public class Menu : Command, ILocalizable
public class Menu : Command, ILocalizable, IBlockCaller
{
[Tooltip("Text to display on the menu button")]
[TextArea()]
@ -101,6 +101,16 @@ namespace Fungus
base.HasReference(variable);
}
public bool MayCallBlock(Block block)
{
return block == targetBlock;
}
public string GetLocationIdentifier()
{
return ParentBlock.GetFlowchart().GetName() + ":" + ParentBlock.BlockName + ".Menu:" + CommandIndex.ToString();
}
#endregion
#region ILocalizable implementation

12
Assets/Fungus/Scripts/Commands/MenuTimer.cs

@ -15,7 +15,7 @@ namespace Fungus
"Displays a timer bar and executes a target block if the player fails to select a menu option in time.")]
[AddComponentMenu("")]
[ExecuteInEditMode]
public class MenuTimer : Command
public class MenuTimer : Command, IBlockCaller
{
[Tooltip("Length of time to display the timer for")]
[SerializeField] protected FloatData _duration = new FloatData(1);
@ -68,6 +68,16 @@ namespace Fungus
base.HasReference(variable);
}
public bool MayCallBlock(Block block)
{
return block == targetBlock;
}
public string GetLocationIdentifier()
{
return ParentBlock.GetFlowchart().GetName() + ":" + ParentBlock.BlockName + ".Menu Timer:" + CommandIndex.ToString();
}
#endregion
#region Backwards compatibility

14
Assets/Fungus/Scripts/Commands/StopBlock.cs

@ -11,7 +11,7 @@ namespace Fungus
[CommandInfo("Flow",
"Stop Block",
"Stops executing the named Block")]
public class StopBlock : Command
public class StopBlock : Command, IBlockCaller
{
[Tooltip("Flowchart containing the Block. If none is specified, the parent Flowchart is used.")]
[SerializeField] protected Flowchart flowchart;
@ -60,6 +60,18 @@ namespace Fungus
return blockName.stringRef == variable || base.HasReference(variable);
}
public bool MayCallBlock(Block block)
{
if(flowchart != null)
return block == flowchart.FindBlock(blockName.Value);
return false;
}
public string GetLocationIdentifier()
{
return ParentBlock.GetFlowchart().GetName() + ":" + ParentBlock.BlockName + ".StopBlock:" + CommandIndex.ToString();
}
#endregion
}
}

29
Assets/Fungus/Scripts/Components/Block.cs

@ -61,6 +61,15 @@ namespace Fungus
protected bool executionInfoSet = false;
/// <summary>
/// If set, flowchart will not auto select when it is next executed, used by eventhandlers.
/// Only effects the editor.
/// </summary>
public bool SuppressNextAutoSelection { get; set; }
[SerializeField] bool suppressAllAutoSelections = false;
protected virtual void Awake()
{
SetExecutionInfo();
@ -225,13 +234,23 @@ namespace Fungus
executionState = ExecutionState.Executing;
BlockSignals.DoBlockStart(this);
bool suppressSelectionChanges = false;
#if UNITY_EDITOR
// Select the executing block & the first command
flowchart.SelectedBlock = this;
if (commandList.Count > 0)
if (suppressAllAutoSelections || SuppressNextAutoSelection)
{
flowchart.ClearSelectedCommands();
flowchart.AddSelectedCommand(commandList[0]);
SuppressNextAutoSelection = false;
suppressSelectionChanges = true;
}
else
{
flowchart.SelectedBlock = this;
if (commandList.Count > 0)
{
flowchart.ClearSelectedCommands();
flowchart.AddSelectedCommand(commandList[0]);
}
}
#endif
@ -274,7 +293,7 @@ namespace Fungus
var command = commandList[i];
activeCommand = command;
if (flowchart.IsActive())
if (flowchart.IsActive() && !suppressSelectionChanges)
{
// Auto select a command in some situations
if ((flowchart.SelectedCommands.Count == 0 && i == 0) ||

17
Assets/Fungus/Scripts/Components/Command.cs

@ -39,7 +39,7 @@ namespace Fungus
/// <summary>
/// Base class for Commands. Commands can be added to Blocks to create an execution sequence.
/// </summary>
public abstract class Command : MonoBehaviour
public abstract class Command : MonoBehaviour, IVariableReference
{
[FormerlySerializedAs("commandId")]
[HideInInspector]
@ -228,6 +228,11 @@ namespace Fungus
return false;
}
public virtual string GetLocationIdentifier()
{
return ParentBlock.GetFlowchart().GetName() + ":" + ParentBlock.BlockName + "." + this.GetType().Name + ":" + CommandIndex.ToString();
}
/// <summary>
/// Called by unity when script is loaded or its data changed by editor
/// </summary>
@ -246,6 +251,14 @@ namespace Fungus
return "";
}
/// <summary>
/// Returns the searchable content for searches on the flowchart window.
/// </summary>
public virtual string GetSearchableContent()
{
return GetSummary();
}
/// <summary>
/// Returns the help text to display for this command.
/// </summary>
@ -316,7 +329,7 @@ namespace Fungus
}
return localizationId;
}
}
#endregion
}

8
Assets/Fungus/Scripts/Components/EventHandler.cs

@ -41,6 +41,9 @@ namespace Fungus
[FormerlySerializedAs("parentSequence")]
[SerializeField] protected Block parentBlock;
[Tooltip("If true, the flowchart window will not auto select the Block when the Event Handler fires. Affects Editor only.")]
[SerializeField] protected bool suppressBlockAutoSelect = false;
#region Public members
/// <summary>
@ -71,10 +74,9 @@ namespace Fungus
return false;
}
// Auto-follow the executing block if none is currently selected
if (flowchart.SelectedBlock == null)
if (suppressBlockAutoSelect)
{
flowchart.SelectedBlock = ParentBlock;
ParentBlock.SuppressNextAutoSelection = true;
}
return flowchart.ExecuteBlock(ParentBlock);

13
Assets/Fungus/Scripts/Components/Flowchart.cs

@ -1186,7 +1186,18 @@ namespace Fungus
var res = gameObject.GetComponents<Block>();
selectedBlocks = res.Where(x => x.IsSelected).ToList();
}
public void ReverseUpdateSelectedCache()
{
for (int i = 0; i < selectedBlocks.Count; i++)
{
if(selectedBlocks[i] != null)
{
selectedBlocks[i].IsSelected = true;
}
}
}
/// <summary>
/// Reset the commands and variables in the Flowchart.
/// </summary>

12
Assets/Fungus/Scripts/Components/MenuDialog.cs

@ -240,10 +240,6 @@ namespace Fungus
if (block != null)
{
var flowchart = block.GetFlowchart();
#if UNITY_EDITOR
// Select the new target block in the Flowchart window
flowchart.SelectedBlock = block;
#endif
gameObject.SetActive(false);
// Use a coroutine to call the block on the next frame
// Have to use the Flowchart gameobject as the MenuDialog is now inactive
@ -294,8 +290,10 @@ namespace Fungus
private bool AddOption(string text, bool interactable, bool hideOption, UnityEngine.Events.UnityAction action)
{
if (nextOptionIndex >= CachedButtons.Length)
{
Debug.LogWarning("Unable to add menu item, not enough buttons: " + text);
return false;
}
//if first option notify that a menu has started
if(nextOptionIndex == 0)
MenuSignals.DoMenuStart(this);
@ -344,6 +342,10 @@ namespace Fungus
StopAllCoroutines();
StartCoroutine(WaitForTimeout(duration, targetBlock));
}
else
{
Debug.LogWarning("Unable to show timer, no slider set");
}
}
/// <summary>

11
Assets/Fungus/Scripts/Components/Variable.cs

@ -122,6 +122,12 @@ namespace Fungus
/// </summary>
public abstract void OnReset();
/// <summary>
/// Boxed or referenced value of type defined within inherited types.
/// Not recommended for direct use, primarily intended for use in editor code.
/// </summary>
public abstract object GetValue();
#endregion
}
@ -178,6 +184,11 @@ namespace Fungus
}
}
public override object GetValue()
{
return value;
}
protected T startValue;
public override void OnReset()

21
Assets/Fungus/Scripts/Components/Writer.cs

@ -510,6 +510,7 @@ namespace Fungus
yield return null;
}
//actually grab the next chars
PartitionString(writeWholeWords, param, i);
ConcatenateString(startText);
textAdapter.Text = outputString.ToString();
@ -533,13 +534,21 @@ namespace Fungus
// Delay between characters
if (currentWritingSpeed > 0f)
{
if (timeAccumulator > 0f)
{
timeAccumulator -= 1f / currentWritingSpeed;
}
else
float invWritingSpeed = 1f / currentWritingSpeed;
timeAccumulator -= invWritingSpeed;
if (timeAccumulator <= 0f)
{
yield return new WaitForSeconds(1f / currentWritingSpeed);
if (invWritingSpeed > Time.deltaTime)
{
yield return new WaitForSeconds(invWritingSpeed);
timeAccumulator += invWritingSpeed;
}
else
{
yield return null;
timeAccumulator += Time.deltaTime;
}
}
}
}

45
Assets/Fungus/Scripts/Editor/BlockEditor.cs

@ -33,6 +33,9 @@ namespace Fungus.EditorUtils
private Rect lastEventPopupPos, lastCMDpopupPos;
private string callersString;
private bool callersFoldout;
protected virtual void OnEnable()
{
@ -56,6 +59,25 @@ namespace Fungus.EditorUtils
commandListProperty = serializedObject.FindProperty("commandList");
commandListAdaptor = new CommandListAdaptor(target as Block, commandListProperty);
}
protected void CacheCallerString()
{
if (!string.IsNullOrEmpty(callersString))
return;
var targetBlock = target as Block;
var callers = FindObjectsOfType<MonoBehaviour>()
.Where(x => x is IBlockCaller)
.Select(x => x as IBlockCaller)
.Where(x => x.MayCallBlock(targetBlock))
.Select(x => x.GetLocationIdentifier()).ToList();
if (callers.Count > 0)
callersString = string.Join("\n", callers);
else
callersString = "None";
}
@ -132,6 +154,21 @@ namespace Fungus.EditorUtils
SerializedProperty descriptionProp = serializedObject.FindProperty("description");
EditorGUILayout.PropertyField(descriptionProp);
SerializedProperty suppressProp = serializedObject.FindProperty("suppressAllAutoSelections");
EditorGUILayout.PropertyField(suppressProp);
EditorGUI.indentLevel++;
if (callersFoldout = EditorGUILayout.Foldout(callersFoldout, "Callers"))
{
CacheCallerString();
GUI.enabled = false;
EditorGUILayout.TextArea(callersString);
GUI.enabled = true;
}
EditorGUI.indentLevel--;
EditorGUILayout.Space();
DrawEventHandlerGUI(flowchart);
@ -319,9 +356,15 @@ namespace Fungus.EditorUtils
// Add Button
if (GUILayout.Button(addIcon))
{
//this may be less reliable for HDPI scaling but previous method using editor window height is now returning
// null in 2019.2 suspect ongoing ui changes, so default to screen.height and then attempt to get the better result
int h = Screen.height;
if (EditorWindow.focusedWindow != null) h = (int)EditorWindow.focusedWindow.position.height;
else if (EditorWindow.mouseOverWindow != null) h = (int)EditorWindow.mouseOverWindow.position.height;
CommandSelectorPopupWindowContent.ShowCommandMenu(lastCMDpopupPos, "", target as Block,
(int)(EditorGUIUtility.currentViewWidth),
(int)(EditorWindow.focusedWindow.position.height - lastCMDpopupPos.y));
(int)(h - lastCMDpopupPos.y));
}
// Duplicate Button

8
Assets/Fungus/Scripts/Editor/BlockInspector.cs

@ -93,11 +93,17 @@ namespace Fungus.EditorUtils
return;
}
//if there is no selection but we are drawing, fix that
if (flowchart.SelectedBlocks.Count == 0)
{
flowchart.AddSelectedBlock(block);
}
if (activeBlockEditor == null ||
!block.Equals(activeBlockEditor.target))
{
DestroyImmediate(activeBlockEditor);
activeBlockEditor = Editor.CreateEditor(block) as BlockEditor;
activeBlockEditor = Editor.CreateEditor(block, typeof(BlockEditor)) as BlockEditor;
}
UpdateWindowHeight();

4
Assets/Fungus/Scripts/Editor/CharacterEditor.cs

@ -33,6 +33,7 @@ namespace Fungus.EditorUtils
serializedObject.Update();
Character t = target as Character;
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(nameTextProp, new GUIContent("Name Text", "Name of the character display in the dialog"));
EditorGUILayout.PropertyField(nameColorProp, new GUIContent("Name Color", "Color of name text display in the dialog"));
@ -75,7 +76,8 @@ namespace Fungus.EditorUtils
EditorGUILayout.Separator();
EditorUtility.SetDirty(t);
if(EditorGUI.EndChangeCheck())
EditorUtility.SetDirty(t);
serializedObject.ApplyModifiedProperties();
}

73
Assets/Fungus/Scripts/Editor/CommandListAdaptor.cs

@ -10,9 +10,34 @@ namespace Fungus.EditorUtils
{
public class CommandListAdaptor
{
public void DrawCommandList()
{
if (summaryStyle == null)
{
summaryStyle = new GUIStyle();
summaryStyle.fontSize = 10;
summaryStyle.padding.top += 5;
summaryStyle.richText = true;
summaryStyle.wordWrap = false;
summaryStyle.clipping = TextClipping.Clip;
}
if (commandLabelStyle == null)
{
commandLabelStyle = new GUIStyle(GUI.skin.box);
commandLabelStyle.normal.background = FungusEditorResources.CommandBackground;
int borderSize = 5;
commandLabelStyle.border.top = borderSize;
commandLabelStyle.border.bottom = borderSize;
commandLabelStyle.border.left = borderSize;
commandLabelStyle.border.right = borderSize;
commandLabelStyle.alignment = TextAnchor.MiddleLeft;
commandLabelStyle.richText = true;
commandLabelStyle.fontSize = 11;
commandLabelStyle.padding.top -= 1;
commandLabelStyle.alignment = TextAnchor.MiddleLeft;
}
if (block.CommandList.Count == 0)
{
EditorGUILayout.HelpBox("Press the + button below to add a command to the list.", MessageType.Info);
@ -30,6 +55,7 @@ namespace Fungus.EditorUtils
protected ReorderableList list;
protected Block block;
protected GUIStyle summaryStyle, commandLabelStyle;
public float fixedItemHeight;
@ -66,11 +92,14 @@ namespace Fungus.EditorUtils
private void DrawHeader(Rect rect)
{
if (rect.width < 0) return;
EditorGUI.LabelField(rect, new GUIContent("Commands"));
}
public void DrawItem(Rect position, int index, bool selected, bool focused)
{
if (position.width < 0) return;
Command command = this[index].objectReferenceValue as Command;
if (command == null)
@ -93,7 +122,6 @@ namespace Fungus.EditorUtils
bool isComment = command.GetType() == typeof(Comment);
bool isLabel = (command.GetType() == typeof(Label));
bool error = false;
string summary = command.GetSummary();
if (summary == null)
{
@ -105,7 +133,7 @@ namespace Fungus.EditorUtils
}
if (summary.StartsWith("Error:"))
{
error = true;
summary = "<color=red> " + summary + "</color>";
}
if (isComment || isLabel)
@ -128,19 +156,7 @@ namespace Fungus.EditorUtils
}
string commandName = commandInfoAttr.CommandName;
GUIStyle commandLabelStyle = new GUIStyle(GUI.skin.box);
commandLabelStyle.normal.background = FungusEditorResources.CommandBackground;
int borderSize = 5;
commandLabelStyle.border.top = borderSize;
commandLabelStyle.border.bottom = borderSize;
commandLabelStyle.border.left = borderSize;
commandLabelStyle.border.right = borderSize;
commandLabelStyle.alignment = TextAnchor.MiddleLeft;
commandLabelStyle.richText = true;
commandLabelStyle.fontSize = 11;
commandLabelStyle.padding.top -= 1;
float indentSize = 20;
for (int i = 0; i < command.IndentLevel; ++i)
{
@ -303,10 +319,6 @@ namespace Fungus.EditorUtils
{
commandLabelColor = Color.grey;
}
else if (error)
{
// TODO: Show warning icon
}
GUI.backgroundColor = commandLabelColor;
@ -358,28 +370,9 @@ namespace Fungus.EditorUtils
summaryRect.width -= commandNameWidth + 5;
}
GUIStyle summaryStyle = new GUIStyle();
summaryStyle.fontSize = 10;
summaryStyle.padding.top += 5;
summaryStyle.richText = true;
summaryStyle.wordWrap = false;
summaryStyle.clipping = TextClipping.Clip;
commandLabelStyle.alignment = TextAnchor.MiddleLeft;
GUI.Label(summaryRect, summary, summaryStyle);
if (error)
{
GUISkin editorSkin = EditorGUIUtility.GetBuiltinSkin(EditorSkin.Inspector);
Rect errorRect = new Rect(summaryRect);
errorRect.x += errorRect.width - 20;
errorRect.y += 2;
errorRect.width = 20;
GUI.Label(errorRect, editorSkin.GetStyle("CN EntryError").normal.background);
summaryRect.width -= 20;
}
GUI.backgroundColor = Color.white;
}
}
}

29
Assets/Fungus/Scripts/Editor/EditorExtensions.cs

@ -4,6 +4,7 @@
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
namespace Fungus.EditorUtils
{
@ -52,7 +53,7 @@ namespace Fungus.EditorUtils
}
/// <summary>
/// A convenient method for calling the above.
/// A convenient method for calling the above, but for ALL assemblies.
/// Example usage:
/// List<System.Type> subTypes = EditorUtility.FindDerivedTypes(typeof(BaseTimelineEvent)).ToList();
/// </summary>
@ -61,7 +62,31 @@ namespace Fungus.EditorUtils
/// <returns></returns>
public static System.Type[] FindDerivedTypes(System.Type baseType, bool classOnly = true)
{
return FindDerivedTypesFromAssembly(System.Reflection.Assembly.GetAssembly(baseType), baseType, classOnly);
#if UNITY_2019_2_OR_NEWER
var results = TypeCache.GetTypesDerivedFrom(baseType).ToArray();
if (classOnly)
return results.Where(x => x.IsClass).ToArray();
else
return results.ToArray();
#else
System.Type[] typeArray = new System.Type[0];
var retval = typeArray.Concat(typeArray);
foreach (var assem in System.AppDomain.CurrentDomain.GetAssemblies())
{
retval = retval.Concat(FindDerivedTypesFromAssembly(assem, baseType, classOnly));
}
return retval.ToArray();
#endif
}
/// <summary>
/// Find and return all Unity.Objects that have the target interface
/// </summary>
/// <typeparam name="T">Intended to be an interface but will work for any</typeparam>
/// <returns></returns>
public static List<T> FindObjectsOfInterface<T>()
{
return Object.FindObjectsOfType<Object>().OfType<T>().ToList();
}
}
}

118
Assets/Fungus/Scripts/Editor/FlowchartWindow.cs

@ -264,13 +264,30 @@ namespace Fungus.EditorUtils
EditorApplication.update += OnEditorUpdate;
Undo.undoRedoPerformed += Undo_ForceRepaint;
#if UNITY_2017_4_OR_NEWER
EditorApplication.playModeStateChanged += EditorApplication_playModeStateChanged;
#endif
}
protected virtual void OnDisable()
{
EditorApplication.update -= OnEditorUpdate;
Undo.undoRedoPerformed -= Undo_ForceRepaint;
#if UNITY_2017_4_OR_NEWER
EditorApplication.playModeStateChanged -= EditorApplication_playModeStateChanged;
#endif
}
#if UNITY_2017_4_OR_NEWER
private void EditorApplication_playModeStateChanged(PlayModeStateChange obj)
{
//force null so it can refresh context on the other side of the context
flowchart = null;
prevFlowchart = null;
blockInspector = null;
}
#endif
protected void Undo_ForceRepaint()
{
@ -336,6 +353,7 @@ namespace Fungus.EditorUtils
if (flowchart == null)
{
blocks = new Block[0];
filteredBlocks = new Block[0];
}
else
{
@ -347,6 +365,8 @@ namespace Fungus.EditorUtils
protected virtual void OnInspectorUpdate()
{
if (HandleFlowchartSelectionChange()) return;
// Ensure the Block Inspector is always showing the currently selected block
var flowchart = GetFlowchart();
if (flowchart == null || AnyNullBLocks())
@ -450,14 +470,23 @@ namespace Fungus.EditorUtils
{
filterStale = false;
//reset all
foreach (var item in filteredBlocks)
for (int i = 0; filteredBlocks != null && i < filteredBlocks.Length; i++)
{
item.IsFiltered = false;
if (filteredBlocks[i] != null)
{
filteredBlocks[i].IsFiltered = false;
}
}
var nullCount = filteredBlocks.Count(x => x == null);
if (nullCount > 0 && nullCount != filteredBlocks.Length)
{
Debug.LogWarning("Null block found in filteredBlocks. May be a symptom of an underlying issue");
}
//gather new
filteredBlocks = blocks.Where(block => block.BlockName.ToLower().Contains(searchString.ToLower())).ToArray();
filteredBlocks = blocks.Where(block => IsBlockNameMatch(block) || IsCommandContentMatch(block)).ToArray();
//update filteredness
foreach (var item in filteredBlocks)
{
@ -468,6 +497,16 @@ namespace Fungus.EditorUtils
}
}
private bool IsBlockNameMatch(Block block)
{
return block.BlockName.IndexOf(searchString, StringComparison.OrdinalIgnoreCase) >= 0;
}
private bool IsCommandContentMatch(Block block)
{
return block.CommandList.Any(command => command.GetSearchableContent().IndexOf(searchString, StringComparison.OrdinalIgnoreCase) >= 0);
}
protected virtual void HandleEarlyEvents(Event e)
{
switch (e.type)
@ -573,9 +612,16 @@ namespace Fungus.EditorUtils
{
mouseDownSelectionState.AddRange(flowchart.SelectedBlocks);
flowchart.ClearSelectedBlocks();
foreach (var item in mouseDownSelectionState)
for (int i = 0; i < mouseDownSelectionState.Count; i++)
{
item.IsControlSelected = true;
if (mouseDownSelectionState[i] != null)
{
mouseDownSelectionState[i].IsControlSelected = true;
}
else
{
Debug.LogWarning("Null block found in mouseDownSelectionState. May be a symptom of an underlying issue");
}
}
}
@ -633,7 +679,22 @@ namespace Fungus.EditorUtils
blockInspector = null;
prevFlowchart = flowchart;
executingBlocks.ClearAll();
//attempt to defilter previous, if due to scene change these will be null
// the regular filter updates will still occur within UpdateBlockCollection
for (int i = 0; i < filteredBlocks.Length; i++)
{
if (filteredBlocks[i] != null)
{
filteredBlocks[i].IsFiltered = false;
}
}
UpdateBlockCollection();
if(flowchart != null)
flowchart.ReverseUpdateSelectedCache();//becomes reverse restore selected cache
Repaint();
return true;
}
@ -1186,6 +1247,21 @@ namespace Fungus.EditorUtils
menu.AddItem(new GUIContent ("Cut"), false, () => Cut());
menu.AddItem(new GUIContent ("Duplicate"), false, () => Duplicate());
menu.AddItem(new GUIContent ("Delete"), false, () => AddToDeleteList(blockList));
menu.AddSeparator("");
if(Application.isPlaying)
{
menu.AddItem(new GUIContent("StopAll"), false, () => StopAllBlocks());
menu.AddItem(new GUIContent("Stop"), false, () => StopThisBlock(hitBlock));
menu.AddItem(new GUIContent("Execute"), false, () => ExecuteThisBlock(hitBlock, false));
menu.AddItem(new GUIContent("Execute (Stop All First)"), false, () => ExecuteThisBlock(hitBlock, true));
}
else
{
menu.AddDisabledItem(new GUIContent("StopAll"), false);//, () => StopAllBlocks());
menu.AddDisabledItem(new GUIContent("Stop"), false);//, () => StopThisBlock(hitBlock));
menu.AddDisabledItem(new GUIContent("Execute"), false);//, () => ExecuteThisBlock(hitBlock, false));
menu.AddDisabledItem(new GUIContent("Execute (Stop All First)"), false);//, () => ExecuteThisBlock(hitBlock, true));
}
}
else
{
@ -1201,6 +1277,16 @@ namespace Fungus.EditorUtils
{
menu.AddDisabledItem(new GUIContent("Paste"));
}
menu.AddSeparator("");
if (Application.isPlaying)
{
menu.AddItem(new GUIContent("StopAll"), false, () => StopAllBlocks());
}
else
{
menu.AddDisabledItem(new GUIContent("StopAll"), false);//, () => StopAllBlocks());
}
}
var menuRect = new Rect();
@ -1606,6 +1692,24 @@ namespace Fungus.EditorUtils
}
}
internal void StopThisBlock(Block block)
{
block.Stop();
}
internal void StopAllBlocks()
{
flowchart.StopAllBlocks();
}
internal void ExecuteThisBlock(Block block, bool stopRunningBlocks)
{
if (stopRunningBlocks)
StopAllBlocks();
block.StartExecution();
}
public void DeleteBlocks()
{
// Delete any scheduled objects

17
Assets/Fungus/Scripts/Editor/FungusEditor.asmdef

@ -0,0 +1,17 @@
{
"name": "FungusEditor",
"references": [
"GUID:007db7f7a4c8f944990d71603a110f82"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}

7
Assets/Fungus/Scripts/Editor/FungusEditor.asmdef.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 34cf00d3f10a8f34783a2f8b914a0219
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

52
Assets/Fungus/Scripts/Editor/FungusEditorPreferences.cs

@ -1,6 +1,6 @@
using UnityEngine;
using System.Linq;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
namespace Fungus
{
@ -16,8 +16,8 @@ namespace Fungus
{
// Have we loaded the prefs yet
private static bool prefsLoaded = false;
const string HIDE_MUSH_KEY = "hideMushroomInHierarchy";
const string USE_LEGACY_MENUS = "useLegacyMenus";
private const string HIDE_MUSH_KEY = "hideMushroomInHierarchy";
private const string USE_LEGACY_MENUS = "useLegacyMenus";
public static bool hideMushroomInHierarchy;
public static bool useLegacyMenus;
@ -47,6 +47,50 @@ namespace Fungus
hideMushroomInHierarchy = EditorGUILayout.Toggle("Hide Mushroom Flowchart Icon", hideMushroomInHierarchy);
useLegacyMenus = EditorGUILayout.Toggle(new GUIContent("Legacy Menus", "Force Legacy menus for Event, Add Variable and Add Command menus"), useLegacyMenus);
EditorGUILayout.Space();
//ideally if any are null, but typically it is all or nothing that have broken links due to version changes or moving files external to Unity
if (FungusEditorResources.Add == null)
{
EditorGUILayout.HelpBox("FungusEditorResources need to be regenerated!", MessageType.Error);
}
if (GUILayout.Button(new GUIContent("Select Fungus Editor Resources SO", "If Fungus icons are not showing correctly you may need to reassign the references in the FungusEditorResources. Button below will locate it.")))
{
var ids = AssetDatabase.FindAssets("t:FungusEditorResources");
if (ids.Length > 0)
{
var p = AssetDatabase.GUIDToAssetPath(ids[0]);
var asset = AssetDatabase.LoadAssetAtPath<FungusEditorResources>(p);
Selection.activeObject = asset;
}
else
{
Debug.LogError("No FungusEditorResources found!");
}
}
if (GUILayout.Button("Open Changelog (version info)"))
{
//From project path down, look for our Fungus\Docs\ChangeLog.txt
var projectPath = System.IO.Directory.GetParent(Application.dataPath);
var fileMacthes = System.IO.Directory.GetFiles(projectPath.FullName, "CHANGELOG.txt", System.IO.SearchOption.AllDirectories);
fileMacthes = fileMacthes.Where((x) =>
{
var fileFolder = System.IO.Directory.GetParent(x);
return fileFolder.Name == "Docs" && fileFolder.Parent.Name == "Fungus";
}).ToArray();
if (fileMacthes == null || fileMacthes.Length == 0)
{
Debug.LogWarning("Cannot locate Fungus\\Docs\\CHANGELONG.txt");
}
else
{
Application.OpenURL(fileMacthes[0]);
}
}
// Save the preferences
if (GUI.changed)
{

17
Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs

@ -0,0 +1,17 @@
using UnityEngine;
using UnityEditor.Experimental.AssetImporters;
using System.IO;
namespace Fungus.EditorUtils
{
[ScriptedImporter(1, "lua")]
public class LuaScriptedImporter : ScriptedImporter
{
public override void OnImportAsset(AssetImportContext ctx)
{
TextAsset lua = new TextAsset(File.ReadAllText(ctx.assetPath));
ctx.AddObjectToAsset("main", lua);
ctx.SetMainObject(lua);
}
}
}

11
Assets/Fungus/Scripts/Editor/LuaScriptedImporter.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d97e7e55c88779e4ca8688698c573c4e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

28
Assets/Fungus/Scripts/Editor/PopupContent/VariableSelectPopupWindowContent.cs

@ -115,7 +115,12 @@ namespace Fungus.EditorUtils
{
}
protected static void AddVariable(object obj)
public static void AddVariable(object obj)
{
AddVariable(obj, string.Empty);
}
public static void AddVariable(object obj, string suggestedName)
{
System.Type t = obj as System.Type;
if (t == null)
@ -123,13 +128,24 @@ namespace Fungus.EditorUtils
return;
}
Undo.RecordObject(curFlowchart, "Add Variable");
Variable newVariable = curFlowchart.gameObject.AddComponent(t) as Variable;
newVariable.Key = curFlowchart.GetUniqueVariableKey("");
curFlowchart.Variables.Add(newVariable);
var flowchart = curFlowchart != null ? curFlowchart : FlowchartWindow.GetFlowchart();
Undo.RecordObject(flowchart, "Add Variable");
Variable newVariable = flowchart.gameObject.AddComponent(t) as Variable;
newVariable.Key = flowchart.GetUniqueVariableKey(suggestedName);
//if suggested exists, then insert, if not just add
var existingVariable = flowchart.GetVariable(suggestedName);
if (existingVariable != null)
{
flowchart.Variables.Insert(flowchart.Variables.IndexOf(existingVariable)+1, newVariable);
}
else
{
flowchart.Variables.Add(newVariable);
}
// Because this is an async call, we need to force prefab instances to record changes
PrefabUtility.RecordPrefabInstancePropertyModifications(curFlowchart);
PrefabUtility.RecordPrefabInstancePropertyModifications(flowchart);
}
}
}

68
Assets/Fungus/Scripts/Editor/VariableListAdaptor.cs

@ -1,12 +1,12 @@
// 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 UnityEditor;
using System;
using UnityEditorInternal;
using System.Collections.Generic;
using System.Linq;
namespace Fungus.EditorUtils
{
@ -47,6 +47,18 @@ namespace Fungus.EditorUtils
return this[index].objectReferenceValue as Variable;
}
public void SetVarAt(int index, Variable v)
{
if (list.list != null)
{
list.list[index] = v;
}
else
{
this[index].objectReferenceValue = v;
}
}
public VariableListAdaptor(SerializedProperty arrayProperty, Flowchart _targetFlowchart)
{
if (arrayProperty == null)
@ -152,6 +164,11 @@ namespace Fungus.EditorUtils
return;
}
if(Event.current.type == EventType.ContextClick && position.Contains(Event.current.mousePosition))
{
DoRightClickMenu(index);
}
for (int i = 0; i < 4; ++i)
{
itemRects[i] = position;
@ -262,6 +279,55 @@ namespace Fungus.EditorUtils
GUI.backgroundColor = Color.white;
}
private void DoRightClickMenu(int index)
{
var v = GetVarAt(index);
GenericMenu commandMenu = new GenericMenu();
commandMenu.AddItem(new GUIContent("Remove"), false, () => {list.index = index; RemoveItem(list); });
commandMenu.AddItem(new GUIContent("Duplicate"), false, () => VariableSelectPopupWindowContent.AddVariable(v.GetType(), v.Key));
commandMenu.AddItem(new GUIContent("Find References"), false, () => FindUsage(GetVarAt(index)));
commandMenu.AddSeparator("");
commandMenu.AddItem(new GUIContent("Sort by Name"), false, () => SortBy(x => x.Key));
commandMenu.AddItem(new GUIContent("Sort by Type"), false, () => SortBy(x => x.GetType().Name));
commandMenu.AddItem(new GUIContent("Sort by Value"), false, () => SortBy(x => x.GetValue()));
commandMenu.ShowAsContext();
}
private void SortBy<TKey>(Func<Variable, TKey> orderFunc)
{
List<Variable> vars = new List<Variable>();
for (int i = 0; i < list.count; i++)
{
vars.Add(GetVarAt(i));
}
vars = vars.OrderBy(orderFunc).ToList();
for (int i = 0; i < list.count; i++)
{
SetVarAt(i, vars[i]);
}
_arrayProperty.serializedObject.ApplyModifiedProperties();
}
private void FindUsage(Variable variable)
{
var varRefs = EditorExtensions.FindObjectsOfInterface<IVariableReference>()
.Where(x => x.HasReference(variable))
.Select(x => x.GetLocationIdentifier()).ToList(); ;
string varRefString = variable.Key + " referenced in;\n";
if (varRefs.Count > 0)
varRefString += string.Join("\n", varRefs);
else
varRefString += "None";
Debug.Log(varRefString);
}
}
}

10
Assets/Fungus/Scripts/Interfaces/IBlockCaller.cs

@ -0,0 +1,10 @@
namespace Fungus
{
/// <summary>
/// Interface for indicating that the class holds a reference to and may call a block
/// </summary>
public interface IBlockCaller : IStringLocationIdentifier
{
bool MayCallBlock(Block block);
}
}

11
Assets/Fungus/Scripts/Interfaces/IBlockCaller.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c14d678ff547d8944a1a28e12c00868e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

11
Assets/Fungus/Scripts/Interfaces/IStringLocationIdentifier.cs

@ -0,0 +1,11 @@
namespace Fungus
{
/// <summary>
/// Interface for providing a human readable path to an element, used in editor code to determine where
/// something exists elsewhere in the scene.
/// </summary>
public interface IStringLocationIdentifier
{
string GetLocationIdentifier();
}
}

11
Assets/Fungus/Scripts/Interfaces/IStringLocationIdentifier.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2993a9ad5bc21254d9ec5d09528775c0
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

10
Assets/Fungus/Scripts/Interfaces/IVariableReference.cs

@ -0,0 +1,10 @@
namespace Fungus
{
/// <summary>
/// Interface for indicating that the class holds a reference to a fungus variable, used primarily in editor.
/// </summary>
public interface IVariableReference : IStringLocationIdentifier
{
bool HasReference(Variable variable);
}
}

11
Assets/Fungus/Scripts/Interfaces/IVariableReference.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e8efeca0dcf047241abed0f0f00d1afd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

3
Assets/Fungus/Scripts/Utils/BlockReference.cs

@ -9,6 +9,9 @@ namespace Fungus
/// This is the recommended way to directly reference a fungus block in external c# scripts,
/// as it will give you an inspector field that gives a drop down of all the blocks on a
/// flowchart, in a similar way to what you would expect from selecting a block on a command.
///
/// If you want to showup in the Callers section of the block, ensure your monobehaviours
/// that have these also implement IBlockCaller.
/// </summary>
[System.Serializable]
public struct BlockReference

3
Assets/Fungus/Scripts/Utils/VariableReference.cs

@ -5,6 +5,9 @@
/// This is the a way to directly reference a fungus variable in external c# scripts, it will
/// give you an inspector field that gives a drop down of all the variables on the targeted
/// flowchart, in a similar way to what you would expect from selecting a variable on a command.
///
/// Also recommend implementing IVariableReference on any custom classes that use this so your
/// references can show up in searches for usage.
/// </summary>
[System.Serializable]
public struct VariableReference

17
Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/Fungus.FungusLuaEditor.asmdef vendored

@ -0,0 +1,17 @@
{
"name": "Fungus.FungusLuaEditor",
"references": [
"GUID:007db7f7a4c8f944990d71603a110f82"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}

7
Assets/Fungus/Thirdparty/FungusLua/Scripts/Editor/Fungus.FungusLuaEditor.asmdef.meta vendored

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 68356f51e7c115448be4b12e1d73df06
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

17
Assets/Fungus/Thirdparty/LineEndings/Editor/Fungus.LineEndingsEditor.asmdef vendored

@ -0,0 +1,17 @@
{
"name": "Fungus.LineEndingsEditor",
"references": [
"GUID:007db7f7a4c8f944990d71603a110f82"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}

7
Assets/Fungus/Thirdparty/LineEndings/Editor/Fungus.LineEndingsEditor.asmdef.meta vendored

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c2b511c416619ce4488b142fc194a244
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

17
Assets/Fungus/Thirdparty/Usfxr/Editor/Fungus.UsfxrEditor.asmdef vendored

@ -0,0 +1,17 @@
{
"name": "Fungus.UsfxrEditor",
"references": [
"GUID:007db7f7a4c8f944990d71603a110f82"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}

7
Assets/Fungus/Thirdparty/Usfxr/Editor/Fungus.UsfxrEditor.asmdef.meta vendored

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 0c1b20abafdf15d4cbb15a2d4fef2a97
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

14
Assets/FungusExamples/FungusExamples.asmdef

@ -0,0 +1,14 @@
{
"name": "FungusExamples",
"references": [
"GUID:007db7f7a4c8f944990d71603a110f82"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": []
}

7
Assets/FungusExamples/FungusExamples.asmdef.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d749be870df4c4048a9636146e66f475
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

486
Assets/FungusExamples/TextMeshPro/TMpro Demo.unity

File diff suppressed because it is too large Load Diff

8
Assets/Tests.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f23bed438013a47438010dafdc996ae4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/Tests/Editor.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 66eda60c3533ab546af7641d0d3c8c48
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

69
Assets/Tests/Editor/FungusConversationParseTests.cs

@ -0,0 +1,69 @@
using NUnit.Framework;
using System.Collections.Generic;
public class FungusConversationParseTests
{
private const string SimpleConv =
@"john bored left: Oh, so that's how you use the Conversation command.
sherlock eyeroll right nowait: Yes, well done John. {w=1.5}
You catch on quickly don't you?
sherlock >>>:
hide john ""offscreen left"": I sure do.
-- This is a comment, it doesn't appear in the conversation
";
private static readonly List<Fungus.ConversationManager.RawConversationItem> SimpleConvRes = new List<Fungus.ConversationManager.RawConversationItem>()
{
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "john", "bored", "left" }, text = "Oh, so that's how you use the Conversation command."},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "sherlock", "eyeroll", "right", "nowait" }, text = "Yes, well done John. {w=1.5}"},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ }, text = "You catch on quickly don't you?"},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "sherlock", ">>>" }, text = ""},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "hide", "john", "offscreen left" }, text = "I sure do."},
};
[Test]
public void FungusConversationPreParseSimple()
{
var res = Fungus.ConversationManager.PreParse(SimpleConv);
ValueCompareRawConversationItemLists(res, SimpleConvRes);
}
private void ValueCompareRawConversationItemLists(List<Fungus.ConversationManager.RawConversationItem> lhs, List<Fungus.ConversationManager.RawConversationItem> rhs)
{
Assert.AreEqual(lhs.Count, rhs.Count, "Different number of results found.");
for (int i = 0; i < lhs.Count; i++)
{
Assert.AreEqual(lhs[i].text, rhs[i].text, "RawConItem " + i.ToString() + " has different text body.");
Assert.AreEqual(lhs[i].sayParams.Length, rhs[i].sayParams.Length, "RawConItem " + i.ToString() + " have differing say param counts");
for (int j = 0; j < lhs[i].sayParams.Length; j++)
{
Assert.AreEqual(lhs[i].sayParams[j], rhs[i].sayParams[j], "RawConItem " + i.ToString() + " param: " + j.ToString() + " content");
}
}
}
private const string MultiColonConv =
@"sherlock left: Outragous!
john bashful: This is an overreaction Sherlock.
sherlock: Colon to direct attention to a list. Colon to emphasize connecton between independent phrases.
: To Buy: Eggs, Milk, Flour.
sherlock irate right: In this world, there are only two tragedies: one is not getting what one wants, and the other is getting it.
john smug:Love is blind: sometimes it keeps us from seeing the truth.";
private static readonly List<Fungus.ConversationManager.RawConversationItem> MultiColonConvRes = new List<Fungus.ConversationManager.RawConversationItem>()
{
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "sherlock", "left" }, text = "Outragous!"},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "john", "bashful" }, text = "This is an overreaction Sherlock."},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "sherlock" }, text = "Colon to direct attention to a list. Colon to emphasize connecton between independent phrases."},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ }, text = "To Buy: Eggs, Milk, Flour."},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "sherlock", "irate", "right" }, text = "In this world, there are only two tragedies: one is not getting what one wants, and the other is getting it."},
new Fungus.ConversationManager.RawConversationItem(){ sayParams = new string[]{ "john", "smug" }, text = "Love is blind: sometimes it keeps us from seeing the truth."},
};
[Test]
public void FungusConversationPreParseMultiColon()
{
var res = Fungus.ConversationManager.PreParse(MultiColonConv);
ValueCompareRawConversationItemLists(res, MultiColonConvRes);
}
}

11
Assets/Tests/Editor/FungusConversationParseTests.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 12c18ec6bfbb6af4d935d98619790eb7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

89
Assets/Tests/Editor/FungusPrioritySignalsTest.cs

@ -0,0 +1,89 @@
using UnityEngine;
using UnityEditor;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
public class FungusPrioritySignalsTest {
private int changeCallCount, startCallCount, endCallCount;
[Test]
public void CountsAndSignals()
{
Fungus.FungusPrioritySignals.OnFungusPriorityStart += FungusPrioritySignals_OnFungusPriorityStart;
Fungus.FungusPrioritySignals.OnFungusPriorityEnd += FungusPrioritySignals_OnFungusPriorityEnd;
Fungus.FungusPrioritySignals.OnFungusPriorityChange += FungusPrioritySignals_OnFungusPriorityChange;
Assert.Zero(Fungus.FungusPrioritySignals.CurrentPriorityDepth);
Fungus.FungusPrioritySignals.DoIncreasePriorityDepth();
//one start, one change, no end, 1 depth
Assert.AreEqual(0, endCallCount);
Assert.AreEqual(1, startCallCount);
Assert.AreEqual(1, changeCallCount);
Assert.AreEqual(1, Fungus.FungusPrioritySignals.CurrentPriorityDepth);
Fungus.FungusPrioritySignals.DoIncreasePriorityDepth();
//one start, 2 change, no end, 2 depth
Assert.AreEqual(0, endCallCount);
Assert.AreEqual(1, startCallCount);
Assert.AreEqual(2, changeCallCount);
Assert.AreEqual(2, Fungus.FungusPrioritySignals.CurrentPriorityDepth);
Fungus.FungusPrioritySignals.DoIncreasePriorityDepth();
//one start, 3 change, no end, 3 depth
Assert.AreEqual(0, endCallCount);
Assert.AreEqual(1, startCallCount);
Assert.AreEqual(3, changeCallCount);
Assert.AreEqual(3, Fungus.FungusPrioritySignals.CurrentPriorityDepth);
Fungus.FungusPrioritySignals.DoDecreasePriorityDepth();
//one start, 4 change, no end, 2 depth
Assert.AreEqual(0, endCallCount);
Assert.AreEqual(1, startCallCount);
Assert.AreEqual(4, changeCallCount);
Assert.AreEqual(2, Fungus.FungusPrioritySignals.CurrentPriorityDepth);
Fungus.FungusPrioritySignals.DoDecreasePriorityDepth();
Fungus.FungusPrioritySignals.DoDecreasePriorityDepth();
//one start, 6 change, 1 end, 0 depth
Assert.AreEqual(1, endCallCount);
Assert.AreEqual(1, startCallCount);
Assert.AreEqual(6, changeCallCount);
Assert.AreEqual(0, Fungus.FungusPrioritySignals.CurrentPriorityDepth);
Fungus.FungusPrioritySignals.OnFungusPriorityStart -= FungusPrioritySignals_OnFungusPriorityStart;
Fungus.FungusPrioritySignals.OnFungusPriorityEnd -= FungusPrioritySignals_OnFungusPriorityEnd;
Fungus.FungusPrioritySignals.OnFungusPriorityChange -= FungusPrioritySignals_OnFungusPriorityChange;
//unsubbed so all the same
Fungus.FungusPrioritySignals.DoIncreasePriorityDepth();
Fungus.FungusPrioritySignals.DoDecreasePriorityDepth();
//one start, 6 change, 1 end, 0 depth
Assert.AreEqual(1, endCallCount);
Assert.AreEqual(1, startCallCount);
Assert.AreEqual(6, changeCallCount);
Assert.AreEqual(0, Fungus.FungusPrioritySignals.CurrentPriorityDepth);
}
private void FungusPrioritySignals_OnFungusPriorityChange(int previousActiveDepth, int newActiveDepth)
{
changeCallCount++;
}
private void FungusPrioritySignals_OnFungusPriorityEnd()
{
endCallCount++;
}
private void FungusPrioritySignals_OnFungusPriorityStart()
{
startCallCount++;
}
}

13
Assets/Tests/Editor/FungusPrioritySignalsTest.cs.meta

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 4b20617e7666fda46bd85a41ce882f9d
timeCreated: 1523182238
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

114
Assets/Tests/Editor/FungusTextVariationSelectionTests.cs

@ -0,0 +1,114 @@
using UnityEngine;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
public class FungusTextVariationSelectionTests
{
[Test]
public void SimpleSequenceSelection()
{
Fungus.TextVariationHandler.ClearHistory();
string startingText = @"This is test [a|b|c]";
string startingTextA = @"This is test a";
string startingTextB = @"This is test b";
string startingTextC = @"This is test c";
string res = string.Empty;
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextA);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextB);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextC);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextC);
}
[Test]
public void SimpleCycleSelection()
{
Fungus.TextVariationHandler.ClearHistory();
string startingText = @"This is test [&a|b|c]";
string startingTextA = @"This is test a";
string startingTextB = @"This is test b";
string startingTextC = @"This is test c";
string res = string.Empty;
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextA);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextB);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextC);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextA);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextB);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextC);
}
[Test]
public void SimpleOnceSelection()
{
Fungus.TextVariationHandler.ClearHistory();
string startingText = @"This is test [!a|b|c]";
string startingTextA = @"This is test a";
string startingTextB = @"This is test b";
string startingTextC = @"This is test c";
string startingTextD = @"This is test ";
string res = string.Empty;
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextA);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextB);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextC);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextD);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextD);
}
[Test]
public void NestedSelection()
{
Fungus.TextVariationHandler.ClearHistory();
string startingText = @"This is test [a||sub [~a|b]|[!b|[~c|d]]]";
string startingTextA = @"This is test a";
string startingTextBlank = @"This is test ";
string startingTextSubA = @"This is test sub a";
string startingTextSubB = @"This is test sub b";
string startingTextB = @"This is test b";
string startingTextC = @"This is test c";
string startingTextD = @"This is test d";
string res = string.Empty;
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextA);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextBlank);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
if(res != startingTextSubA && res != startingTextSubB)
{
Assert.Fail();
}
res = Fungus.TextVariationHandler.SelectVariations(startingText);
Assert.AreEqual(res, startingTextB);
res = Fungus.TextVariationHandler.SelectVariations(startingText);
if (res != startingTextC && res != startingTextD)
{
Assert.Fail();
}
}
}

11
Assets/Tests/Editor/FungusTextVariationSelectionTests.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8769bf7410785704f95413bb0865079c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

73
Assets/Tests/Editor/GenerateEverythingMenuItem.cs

@ -0,0 +1,73 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace Fungus.EditorUtils
{
#if UNITY_2019_2_OR_NEWER
public static class GenerateEverythingMenuItem
{
[MenuItem("Tools/Fungus/Utilities/Generate Everything Flowchart")]
public static void GenerateEverythingFlowchart()
{
var newGO = new GameObject("Flowchart w/ EVERYTHING");
var flow = newGO.AddComponent<Flowchart>();
var blockPos = Vector2.zero;
var blockPosStep = new Vector2(0, 60);
//adding a block for all event handlers
foreach (var eventHandlerType in TypeCache.GetTypesWithAttribute<EventHandlerInfoAttribute>())
{
var block = flow.CreateBlock(blockPos);
blockPos += blockPosStep;
block.BlockName = eventHandlerType.Name;
EventHandler newHandler = newGO.AddComponent(eventHandlerType) as EventHandler;
newHandler.ParentBlock = block;
block._EventHandler = newHandler;
}
//reset head
blockPos = new Vector2(200, 0);
//adding a block for each category, fill it with its commands
var blockComCats = new Dictionary<string, Block>();
foreach (var commandType in TypeCache.GetTypesWithAttribute<CommandInfoAttribute>())
{
var commandTypeAttr = commandType.GetCustomAttributes(typeof(CommandInfoAttribute), false)[0] as CommandInfoAttribute;
blockComCats.TryGetValue(commandTypeAttr.Category, out Block targetBlock);
if (targetBlock == null)
{
targetBlock = flow.CreateBlock(blockPos);
blockPos += blockPosStep;
targetBlock.BlockName = commandTypeAttr.Category;
blockComCats[commandTypeAttr.Category] = targetBlock;
}
var newCommand = newGO.AddComponent(commandType) as Command;
newCommand.ParentBlock = targetBlock;
newCommand.ItemId = flow.NextItemId();
// Let command know it has just been added to the block
newCommand.OnCommandAdded(targetBlock);
targetBlock.CommandList.Add(newCommand);
}
//add all variable types
foreach (var varType in TypeCache.GetTypesWithAttribute<VariableInfoAttribute>())
{
Variable newVariable = newGO.AddComponent(varType) as Variable;
newVariable.Key = flow.GetUniqueVariableKey("");
flow.Variables.Add(newVariable);
}
}
}
#endif
}

11
Assets/Tests/Editor/GenerateEverythingMenuItem.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a4db92e2e83406a4ca5ee454733c6f8a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

220
Assets/Tests/Editor/TextTagParserTests.cs

@ -0,0 +1,220 @@
// 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;
#if UNITY_5_3_OR_NEWER
using NUnit.Framework;
[TestFixture]
public class TextTagParserTests
{
[Test]
public void TextTagParser_Parser()
{
// Parse an example string, generate correct sequence of tags
List<TextTagToken> tokens = TextTagParser.Tokenize("Words " +
"{b}bold test{/b}" +
"{i}italic test{/i}" +
"{color=red}color test{/color}" +
"{size=30}size test{/size}" +
"{w}{w=0.5}" +
"{wi}{wc}" +
"{wp}{wp=0.5}{/wp}" +
"{c}" +
"{s}{s=60}{/s}" +
"{x}{m=Message}" +
"{vpunch=0.5}" +
"{hpunch=0.5}" +
"{punch=0.5}" +
"{flash=0.5}" +
"{audio=Sound}" +
"{audioloop=Sound}" +
"{audiopause=Sound}" +
"{audiostop=Sound}");
int i = 0;
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "Words ");
i++;
Assert.That(tokens[i].type == TokenType.BoldStart);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "bold test");
i++;
Assert.That(tokens[i].type == TokenType.BoldEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.ItalicStart);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "italic test");
i++;
Assert.That(tokens[i].type == TokenType.ItalicEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.ColorStart);
Assert.That(tokens[i].paramList[0] == "red");
i++;
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "color test");
i++;
Assert.That(tokens[i].type == TokenType.ColorEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.SizeStart);
Assert.That(tokens[i].paramList[0] == "30");
i++;
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == "size test");
i++;
Assert.That(tokens[i].type == TokenType.SizeEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.Wait);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.Wait);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TokenType.WaitForInputNoClear);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.WaitForInputAndClear);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.WaitOnPunctuationStart);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.WaitOnPunctuationStart);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TokenType.WaitOnPunctuationEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.Clear);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.SpeedStart);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.SpeedStart);
Assert.That(tokens[i].paramList[0] == "60");
i++;
Assert.That(tokens[i].type == TokenType.SpeedEnd);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.Exit);
Assert.That(tokens[i].paramList.Count == 0);
i++;
Assert.That(tokens[i].type == TokenType.Message);
Assert.That(tokens[i].paramList[0] == "Message");
i++;
Assert.That(tokens[i].type == TokenType.VerticalPunch);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TokenType.HorizontalPunch);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TokenType.Punch);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TokenType.Flash);
Assert.That(tokens[i].paramList[0] == "0.5");
i++;
Assert.That(tokens[i].type == TokenType.Audio);
Assert.That(tokens[i].paramList[0] == "Sound");
i++;
Assert.That(tokens[i].type == TokenType.AudioLoop);
Assert.That(tokens[i].paramList[0] == "Sound");
i++;
Assert.That(tokens[i].type == TokenType.AudioPause);
Assert.That(tokens[i].paramList[0] == "Sound");
i++;
Assert.That(tokens[i].type == TokenType.AudioStop);
Assert.That(tokens[i].paramList[0] == "Sound");
Assert.That(tokens.Count == 34);
}
[Test]
public void TextTagParser_AudioWaitBug()
{
// Parse an example string, generate correct sequence of tags
List<TextTagToken> 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);
Assert.That(tokens[i].paramList[0] == "Play sound");
i++;
Assert.That(tokens[i].type == TokenType.Audio);
Assert.That(tokens[i].paramList[0] == "BeepSound");
i++;
Assert.That(tokens[i].type == TokenType.Wait);
Assert.That(tokens[i].paramList[0] == "1");
i++;
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == " Play loop");
i++;
Assert.That(tokens[i].type == TokenType.AudioLoop);
Assert.That(tokens[i].paramList[0] == "BeepSound");
i++;
Assert.That(tokens[i].type == TokenType.Wait);
Assert.That(tokens[i].paramList[0] == "3");
i++;
Assert.That(tokens[i].type == TokenType.Words);
Assert.That(tokens[i].paramList[0] == " Stop");
i++;
Assert.That(tokens[i].type == TokenType.AudioStop);
Assert.That(tokens[i].paramList[0] == "BeepSound");
Assert.That(tokens.Count == 8);
}
}
#endif

12
Assets/Tests/Editor/TextTagParserTests.cs.meta

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a9cea7ad00f8a4d8aa33b09722792171
timeCreated: 1436968375
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

6062
Assets/Tests/Everything.unity

File diff suppressed because it is too large Load Diff

7
Assets/Tests/Everything.unity.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fa2c348035b31d84eb5cf8a0cca9d4d2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

20392
Assets/Tests/ManyBlocks_700+.unity

File diff suppressed because it is too large Load Diff

7
Assets/Tests/ManyBlocks_700+.unity.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c4d1692b35ae833488af6eacb8029e26
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

891
Assets/Tests/SearchableCommands.unity

@ -0,0 +1,891 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
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_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
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}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ShowResolutionOverlay: 1
m_ExportTrainingData: 0
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &1217030777
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1217030780}
- component: {fileID: 1217030779}
- component: {fileID: 1217030778}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1217030778
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1217030777}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1077351063, guid: f70555f144d8491a825f0804e09c671c, 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 &1217030779
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1217030777}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -619905303, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &1217030780
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1217030777}
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
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1230283458
GameObject:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1230283460}
- component: {fileID: 1230283459}
m_Layer: 0
m_Name: _FungusState
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1230283459
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1230283458}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3}
m_Name:
m_EditorClassIdentifier:
selectedFlowchart: {fileID: 1515680124}
--- !u!4 &1230283460
Transform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1230283458}
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
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1455217712
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1455217715}
- component: {fileID: 1455217714}
- component: {fileID: 1455217713}
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 &1455217713
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1455217712}
m_Enabled: 1
--- !u!20 &1455217714
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1455217712}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
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: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1455217715
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1455217712}
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
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1515680107
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1515680125}
- component: {fileID: 1515680124}
- component: {fileID: 1515680123}
- component: {fileID: 1515680122}
- component: {fileID: 1515680121}
- component: {fileID: 1515680120}
- component: {fileID: 1515680119}
- component: {fileID: 1515680118}
- component: {fileID: 1515680117}
- component: {fileID: 1515680116}
- component: {fileID: 1515680115}
- component: {fileID: 1515680114}
- component: {fileID: 1515680113}
- component: {fileID: 1515680112}
- component: {fileID: 1515680111}
- component: {fileID: 1515680110}
- component: {fileID: 1515680109}
- component: {fileID: 1515680108}
m_Layer: 0
m_Name: Flowchart
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1515680108
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f608b8c9fb3044200aac956492d8d586, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 11
indentLevel: 0
conversationText:
stringRef: {fileID: 0}
stringVal: ConversationDialogContent
clearPrevious:
booleanRef: {fileID: 0}
booleanVal: 1
waitForInput:
booleanRef: {fileID: 0}
booleanVal: 1
waitForSeconds:
floatRef: {fileID: 0}
floatVal: 0
fadeWhenDone:
booleanRef: {fileID: 0}
booleanVal: 1
--- !u!114 &1515680109
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 10
indentLevel: 0
storyText: SayDialogContent
description:
character: {fileID: 0}
portrait: {fileID: 0}
voiceOverClip: {fileID: 0}
showAlways: 1
showCount: 1
extendPrevious: 0
fadeWhenDone: 1
waitForClick: 1
stopVoiceover: 1
waitForVO: 0
setSayDialog: {fileID: 0}
--- !u!114 &1515680110
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3}
m_Name:
m_EditorClassIdentifier:
nodeRect:
serializedVersion: 2
x: 564
y: 195
width: 120
height: 40
tint: {r: 1, g: 1, b: 1, a: 1}
useCustomTint: 0
itemId: 9
blockName: Say Content
description:
eventHandler: {fileID: 0}
commandList:
- {fileID: 1515680109}
- {fileID: 1515680108}
--- !u!114 &1515680111
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 93cb9773f2ca04e2bbf7a68ccfc23267, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 8
indentLevel: 0
--- !u!114 &1515680112
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 70c5622b8a80845c980954170295f292, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 7
indentLevel: 0
compareOperator: 0
variable: {fileID: 1515680120}
booleanData:
booleanRef: {fileID: 0}
booleanVal: 0
integerData:
integerRef: {fileID: 0}
integerVal: 0
floatData:
floatRef: {fileID: 0}
floatVal: 0
stringData:
stringRef: {fileID: 0}
stringVal: foo
animatorData:
animatorRef: {fileID: 0}
animatorVal: {fileID: 0}
audioSourceData:
audioSourceRef: {fileID: 0}
audioSourceVal: {fileID: 0}
colorData:
colorRef: {fileID: 0}
colorVal: {r: 0, g: 0, b: 0, a: 0}
gameObjectData:
gameObjectRef: {fileID: 0}
gameObjectVal: {fileID: 0}
materialData:
materialRef: {fileID: 0}
materialVal: {fileID: 0}
objectData:
objectRef: {fileID: 0}
objectVal: {fileID: 0}
rigidbody2DData:
rigidbody2DRef: {fileID: 0}
rigidbody2DVal: {fileID: 0}
spriteData:
spriteRef: {fileID: 0}
spriteVal: {fileID: 0}
textureData:
textureRef: {fileID: 0}
textureVal: {fileID: 0}
transformData:
transformRef: {fileID: 0}
transformVal: {fileID: 0}
vector2Data:
vector2Ref: {fileID: 0}
vector2Val: {x: 0, y: 0}
vector3Data:
vector3Ref: {fileID: 0}
vector3Val: {x: 0, y: 0, z: 0}
--- !u!114 &1515680113
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 93cb9773f2ca04e2bbf7a68ccfc23267, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 6
indentLevel: 1
--- !u!114 &1515680114
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 70c5622b8a80845c980954170295f292, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 5
indentLevel: 1
compareOperator: 0
variable: {fileID: 1515680121}
booleanData:
booleanRef: {fileID: 0}
booleanVal: 0
integerData:
integerRef: {fileID: 0}
integerVal: 0
floatData:
floatRef: {fileID: 0}
floatVal: 0
stringData:
stringRef: {fileID: 0}
stringVal:
animatorData:
animatorRef: {fileID: 0}
animatorVal: {fileID: 0}
audioSourceData:
audioSourceRef: {fileID: 0}
audioSourceVal: {fileID: 0}
colorData:
colorRef: {fileID: 0}
colorVal: {r: 0, g: 0, b: 0, a: 0}
gameObjectData:
gameObjectRef: {fileID: 0}
gameObjectVal: {fileID: 0}
materialData:
materialRef: {fileID: 0}
materialVal: {fileID: 0}
objectData:
objectRef: {fileID: 0}
objectVal: {fileID: 0}
rigidbody2DData:
rigidbody2DRef: {fileID: 0}
rigidbody2DVal: {fileID: 0}
spriteData:
spriteRef: {fileID: 0}
spriteVal: {fileID: 0}
textureData:
textureRef: {fileID: 0}
textureVal: {fileID: 0}
transformData:
transformRef: {fileID: 0}
transformVal: {fileID: 0}
vector2Data:
vector2Ref: {fileID: 0}
vector2Val: {x: 0, y: 0}
vector3Data:
vector3Ref: {fileID: 0}
vector3Val: {x: 0, y: 0, z: 0}
--- !u!114 &1515680115
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 93cb9773f2ca04e2bbf7a68ccfc23267, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 4
indentLevel: 0
--- !u!114 &1515680116
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 70c5622b8a80845c980954170295f292, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 3
indentLevel: 0
compareOperator: 0
variable: {fileID: 1515680122}
booleanData:
booleanRef: {fileID: 0}
booleanVal: 0
integerData:
integerRef: {fileID: 0}
integerVal: 0
floatData:
floatRef: {fileID: 0}
floatVal: 0
stringData:
stringRef: {fileID: 0}
stringVal:
animatorData:
animatorRef: {fileID: 0}
animatorVal: {fileID: 0}
audioSourceData:
audioSourceRef: {fileID: 0}
audioSourceVal: {fileID: 0}
colorData:
colorRef: {fileID: 0}
colorVal: {r: 0, g: 0, b: 0, a: 0}
gameObjectData:
gameObjectRef: {fileID: 0}
gameObjectVal: {fileID: 0}
materialData:
materialRef: {fileID: 0}
materialVal: {fileID: 0}
objectData:
objectRef: {fileID: 0}
objectVal: {fileID: 0}
rigidbody2DData:
rigidbody2DRef: {fileID: 0}
rigidbody2DVal: {fileID: 0}
spriteData:
spriteRef: {fileID: 0}
spriteVal: {fileID: 0}
textureData:
textureRef: {fileID: 0}
textureVal: {fileID: 0}
transformData:
transformRef: {fileID: 0}
transformVal: {fileID: 0}
vector2Data:
vector2Ref: {fileID: 0}
vector2Val: {x: 0, y: 0}
vector3Data:
vector3Ref: {fileID: 0}
vector3Val: {x: 0, y: 0, z: 0}
--- !u!114 &1515680117
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 93cb9773f2ca04e2bbf7a68ccfc23267, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 2
indentLevel: 0
--- !u!114 &1515680118
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 70c5622b8a80845c980954170295f292, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 1
indentLevel: 0
compareOperator: 0
variable: {fileID: 1515680123}
booleanData:
booleanRef: {fileID: 0}
booleanVal: 0
integerData:
integerRef: {fileID: 0}
integerVal: 0
floatData:
floatRef: {fileID: 0}
floatVal: 0
stringData:
stringRef: {fileID: 0}
stringVal:
animatorData:
animatorRef: {fileID: 0}
animatorVal: {fileID: 0}
audioSourceData:
audioSourceRef: {fileID: 0}
audioSourceVal: {fileID: 0}
colorData:
colorRef: {fileID: 0}
colorVal: {r: 0, g: 0, b: 0, a: 0}
gameObjectData:
gameObjectRef: {fileID: 0}
gameObjectVal: {fileID: 0}
materialData:
materialRef: {fileID: 0}
materialVal: {fileID: 0}
objectData:
objectRef: {fileID: 0}
objectVal: {fileID: 0}
rigidbody2DData:
rigidbody2DRef: {fileID: 0}
rigidbody2DVal: {fileID: 0}
spriteData:
spriteRef: {fileID: 0}
spriteVal: {fileID: 0}
textureData:
textureRef: {fileID: 0}
textureVal: {fileID: 0}
transformData:
transformRef: {fileID: 0}
transformVal: {fileID: 0}
vector2Data:
vector2Ref: {fileID: 0}
vector2Val: {x: 0, y: 0}
vector3Data:
vector3Ref: {fileID: 0}
vector3Val: {x: 0, y: 0, z: 0}
--- !u!114 &1515680119
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3}
m_Name:
m_EditorClassIdentifier:
nodeRect:
serializedVersion: 2
x: 230
y: 192
width: 148.2857
height: 40
tint: {r: 1, g: 1, b: 1, a: 1}
useCustomTint: 0
itemId: 0
blockName: Uses All Variables
description:
eventHandler: {fileID: 0}
commandList:
- {fileID: 1515680118}
- {fileID: 1515680117}
- {fileID: 1515680116}
- {fileID: 1515680114}
- {fileID: 1515680113}
- {fileID: 1515680115}
- {fileID: 1515680112}
- {fileID: 1515680111}
--- !u!114 &1515680120
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4580f28dd8581476b810b38eea2f1316, type: 3}
m_Name:
m_EditorClassIdentifier:
scope: 0
key: stringVar
value:
--- !u!114 &1515680121
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: afb91b566ceda411bad1e9d3c3243ecc, type: 3}
m_Name:
m_EditorClassIdentifier:
scope: 0
key: intVar
value: 0
--- !u!114 &1515680122
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 705fa1ac97df74e3a84ff952ffd923f1, type: 3}
m_Name:
m_EditorClassIdentifier:
scope: 0
key: floatVar
value: 0
--- !u!114 &1515680123
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5d02d9822eec54c98afe95bb497211b3, type: 3}
m_Name:
m_EditorClassIdentifier:
scope: 0
key: boolVar
value: 0
--- !u!114 &1515680124
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
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
selectedBlocks: []
selectedCommands: []
variables:
- {fileID: 1515680123}
- {fileID: 1515680122}
- {fileID: 1515680121}
- {fileID: 1515680120}
description:
stepPause: 0
colorCommands: 1
hideComponents: 1
saveSelection: 1
localizationId:
showLineNumbers: 0
hideCommands: []
luaEnvironment: {fileID: 0}
luaBindingName: flowchart
--- !u!4 &1515680125
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1515680107}
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: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

7
Assets/Tests/SearchableCommands.unity.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 87fc82585f625a5488176c000a57429a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

470
Assets/Tests/WritingSpeedTest.unity

@ -0,0 +1,470 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
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_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
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}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightingDataAsset: {fileID: 0}
m_UseShadowmask: 1
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &370263887
GameObject:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 370263889}
- component: {fileID: 370263888}
m_Layer: 0
m_Name: _FungusState
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &370263888
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 370263887}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 61dddfdc5e0e44ca298d8f46f7f5a915, type: 3}
m_Name:
m_EditorClassIdentifier:
selectedFlowchart: {fileID: 911349656}
--- !u!4 &370263889
Transform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 370263887}
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: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &911349655
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 911349659}
- component: {fileID: 911349656}
- component: {fileID: 911349658}
- component: {fileID: 911349657}
- component: {fileID: 911349660}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &911349656
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 911349655}
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: 0
y: 0
width: 0
height: 0
selectedBlocks: []
selectedCommands: []
variables: []
description:
stepPause: 0
colorCommands: 1
hideComponents: 1
saveSelection: 1
localizationId:
showLineNumbers: 0
hideCommands: []
luaEnvironment: {fileID: 0}
luaBindingName: flowchart
--- !u!114 &911349657
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 911349655}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3}
m_Name:
m_EditorClassIdentifier:
itemId: 1
indentLevel: 0
storyText: '{s=10}asd fas dfas dfas {s=30}asdfasd fasdfa sdfa s{s=60}asdf asdfa
s asd f{s=120}dfas dfasd fasd fasdf as dfas dfas dfasd fa{s=600}df a sd f a s
dfasdfas dfasdfasdfasdf asd fasdfa sd fa sd fasd fa sdfa sd fa s d fa sd fasdfasd
fas dfasdfa sdfas dfasdfa'
description:
character: {fileID: 0}
portrait: {fileID: 0}
voiceOverClip: {fileID: 0}
showAlways: 1
showCount: 1
extendPrevious: 0
fadeWhenDone: 1
waitForClick: 1
stopVoiceover: 1
waitForVO: 0
setSayDialog: {fileID: 0}
--- !u!114 &911349658
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 911349655}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3d3d73aef2cfc4f51abf34ac00241f60, type: 3}
m_Name:
m_EditorClassIdentifier:
nodeRect:
serializedVersion: 2
x: 306
y: 116
width: 120
height: 40
tint: {r: 1, g: 1, b: 1, a: 1}
useCustomTint: 0
itemId: 0
blockName: New Block
description:
eventHandler: {fileID: 911349660}
commandList:
- {fileID: 911349657}
--- !u!4 &911349659
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 911349655}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 198.72691, y: 68.892815, z: -59.790787}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &911349660
MonoBehaviour:
m_ObjectHideFlags: 2
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 911349655}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d2f6487d21a03404cb21b245f0242e79, type: 3}
m_Name:
m_EditorClassIdentifier:
parentBlock: {fileID: 911349658}
waitForFrames: 1
--- !u!1 &1382207762
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1382207765}
- component: {fileID: 1382207764}
- component: {fileID: 1382207763}
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 &1382207763
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1382207762}
m_Enabled: 1
--- !u!20 &1382207764
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1382207762}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
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: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1382207765
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1382207762}
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
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1674323546
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1674323550}
- component: {fileID: 1674323549}
- component: {fileID: 1674323548}
- component: {fileID: 1674323547}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1674323547
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1674323546}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2d49b7c1bcd2e07499844da127be038d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ForceModuleActive: 0
--- !u!114 &1674323548
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1674323546}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, 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 &1674323549
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1674323546}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!4 &1674323550
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1674323546}
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
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

7
Assets/Tests/WritingSpeedTest.unity.meta

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f96a570dd766d0042b00f9ec1160738e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

9
CONTRIBUTING.md

@ -6,11 +6,10 @@ Fork and clone the Fungus repo (see [fork a repo] )
Make sure the tests pass locally (see the project readme for instructions).
Make your change. Add tests for your change. Make the tests pass locally.
Make your change. Add tests and/or demo scenes for your change. Make the tests pass locally.
Push to your fork and [submit a pull request][pr].
[pr]: https://github.com/fungusgames/Fungus/compare/
We will try to give initial feedback to pull requests within a few days. However, this may not always be possible. Please be patient, we will look at every pull request as soon as we can.
@ -18,10 +17,12 @@ Your pull request will have a better chance of being accepted if you do the foll
* Send one pull request for each new feature. It's time consuming for us to review multi-feature changes.
* Write tests for each change / new feature (not always possible)
* Follow our coding standard (see project docs)
* Follow our [coding standard]
* Write a [good commit message][commit].
[code of conduct]: https://fungusgames.com/code-of-conduct
[code of conduct]: https://github.com/snozbot/fungus/wiki/code_of_conduct
[commit]: http://chris.beams.io/posts/git-commit/
[fork a repo]: https://help.github.com/articles/fork-a-repo/
[fungus license]: https://github.com/FungusGames/Fungus/blob/master/LICENSE
[pr]: https://github.com/snozbot/fungus/compare
[coding standard]: https://github.com/snozbot/fungus/wiki/coding_standard

16
Logs/Packages-Update.log

@ -1,16 +0,0 @@
=== Fri May 3 22:24:04 2019
Packages were changed.
Update Mode: updateDependencies
The following packages were added:
com.unity.timeline@1.0.0
com.unity.multiplayer-hlapi@1.0.2
com.unity.xr.legacyinputhelpers@2.0.2
The following packages were updated:
com.unity.analytics from version 3.2.2 to 3.3.2
com.unity.collab-proxy from version 1.2.15 to 1.2.16
com.unity.package-manager-ui from version 2.0.3 to 2.1.2
com.unity.purchasing from version 2.0.3 to 2.0.6
com.unity.textmeshpro from version 1.3.0 to 2.0.0

15
Packages/manifest.json

@ -1,15 +1,14 @@
{
"dependencies": {
"com.unity.ads": "2.3.1",
"com.unity.analytics": "3.3.2",
"com.unity.collab-proxy": "1.2.16",
"com.unity.multiplayer-hlapi": "1.0.2",
"com.unity.package-manager-ui": "2.1.2",
"com.unity.purchasing": "2.0.6",
"com.unity.2d.sprite": "1.0.0",
"com.unity.ext.nunit": "1.0.0",
"com.unity.package-manager-ui": "2.2.0",
"com.unity.test-framework": "1.0.13",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.0.2",
"com.unity.timeline": "1.1.0",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",

4
ProjectSettings/ProjectVersion.txt

@ -1,2 +1,2 @@
m_EditorVersion: 2019.1.8f1
m_EditorVersionWithRevision: 2019.1.8f1 (7938dd008a75)
m_EditorVersion: 2019.2.12f1
m_EditorVersionWithRevision: 2019.2.12f1 (b1a7e1fb4fa5)

22
README.md

@ -12,7 +12,7 @@ The goal of Fungus is to provide a free, open source tool for creating interacti
Installation
============
Download & installation instructions and tutorial videos are available on the official Fungus website.
Download & installation instructions and tutorial videos are available in [the wiki](https://github.com/snozbot/fungus/wiki/installation) and the official Fungus website.
http://fungusgames.com
Support
@ -34,26 +34,12 @@ To contribute code to Fungus, please see [CONTRIBUTING][contributing]. If you ar
Many thanks to everyone who has contributed code to the project.
https://github.com/snozbot/fungus/graphs/contributors
Building the documentation
Documentation
==========================
1. Download and install Doxygen from http://www.doxygen.org
2. Run Doxygen and open Docs/Doxyfile
3. Switch to the Run tab and click Run Doxygen.
4. The documentation will be built in the Builds/Docs folder.
To contribute to the documentation please send in a pull request with the changes.
Fungus docs are being moved to the [wiki here](https://github.com/snozbot/fungus/wiki) but are also still available on the [external site](http://fungusdocs.snozbot.com/). Contributions to the wiki welcome and encouraged.
Running the automated tests
===========================
The Unity Test Tools contains a tool called the Platform Runner which builds and runs all the test scenes automatically.
There is currently an issue with the Unity Test Tools on OSX that prevents the Platform Runner running all tests in the project. You can open each scene in the Tests folder individually and use the Unity Test Runner window to run all tests in the editor.
On Windows:
1. Open the Platform Runner via Unity Test Tools > Platform Runner
2. Select the platforms and tests you wish to run (defaults to running all).
3. Run the tests and wait for the results. All tests should pass.
The Unity Test Runner is used for testing some underlying elements. Far more are desired and PRs in this area would most welcome.

Loading…
Cancel
Save