From 57fb72e81f202ea75822e93923d2c110a2abce91 Mon Sep 17 00:00:00 2001 From: Zach Vinless Date: Thu, 3 Nov 2016 08:38:15 -0700 Subject: [PATCH 1/8] Added toolbar in place of floating UI -There is now a toolbar for buttons, etc. at the top -Added min, max, and center buttons to quickly zoom or center the graph -Misc whitespace corrections in code --- .../Fungus/Scripts/Editor/EditorZoomArea.cs | 7 +- .../Fungus/Scripts/Editor/FlowchartWindow.cs | 92 ++++++++++++++----- 2 files changed, 75 insertions(+), 24 deletions(-) diff --git a/Assets/Fungus/Scripts/Editor/EditorZoomArea.cs b/Assets/Fungus/Scripts/Editor/EditorZoomArea.cs index 5d51ef01..7acbceb4 100644 --- a/Assets/Fungus/Scripts/Editor/EditorZoomArea.cs +++ b/Assets/Fungus/Scripts/Editor/EditorZoomArea.cs @@ -56,15 +56,16 @@ namespace Fungus.EditorUtils public class EditorZoomArea { - private const float kEditorWindowTabHeight = 21.0f; private static Matrix4x4 _prevGuiMatrix; + private static Vector2 offset = new Vector2(2.0f, 19.0f); + public static Vector2 Offset { get { return offset; } set { offset = value; } } public static Rect Begin(float zoomScale, Rect screenCoordsArea) { GUI.EndGroup(); // End the group Unity begins automatically for an EditorWindow to clip out the window tab. This allows us to draw outside of the size of the EditorWindow. Rect clippedArea = screenCoordsArea.ScaleSizeBy(1.0f / zoomScale, screenCoordsArea.TopLeft()); - clippedArea.y += kEditorWindowTabHeight; + clippedArea.position += offset; GUI.BeginGroup(clippedArea); _prevGuiMatrix = GUI.matrix; @@ -81,7 +82,7 @@ namespace Fungus.EditorUtils { GUI.matrix = _prevGuiMatrix; GUI.EndGroup(); - GUI.BeginGroup(new Rect(0.0f, kEditorWindowTabHeight, Screen.width, Screen.height)); + GUI.BeginGroup(new Rect(offset.x, offset.y, Screen.width, Screen.height)); } } } \ No newline at end of file diff --git a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs index 5772461a..926fe4aa 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs @@ -7,6 +7,7 @@ using UnityEditorInternal; using System; using System.Linq; using System.Collections.Generic; +using System.Reflection; namespace Fungus.EditorUtils { @@ -88,6 +89,24 @@ namespace Fungus.EditorUtils Repaint(); } + protected virtual void OnBecameVisible() + { + // Ensure that toolbar looks correct in both docked and undocked windows + // The docked value doesn't always report correctly without the delayCall + EditorApplication.delayCall += () => { + var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; + var isDockedMethod = typeof(EditorWindow).GetProperty("docked", flags).GetGetMethod(true); + if ((bool) isDockedMethod.Invoke(this, null)) + { + EditorZoomArea.Offset = new Vector2(2.0f, 19.0f); + } + else + { + EditorZoomArea.Offset = new Vector2(0.0f, 22.0f); + } + }; + } + public static Flowchart GetFlowchart() { // Using a temp hidden object to track the active Flowchart across @@ -158,28 +177,55 @@ namespace Fungus.EditorUtils protected virtual void DrawOverlay(Flowchart flowchart) { - GUILayout.Space(8); + GUILayout.BeginHorizontal(EditorStyles.toolbar); - GUILayout.BeginHorizontal(); - - GUILayout.Space(8); + GUILayout.Space(2); - if (GUILayout.Button(new GUIContent(addTexture, "Add a new block"))) + if (GUILayout.Button(new GUIContent(addTexture, "Add a new block"), EditorStyles.toolbarButton)) { - Vector2 newNodePosition = new Vector2(50 - flowchart.ScrollPos.x, - 50 - flowchart.ScrollPos.y); + Vector2 newNodePosition = new Vector2(50 / flowchart.Zoom - flowchart.ScrollPos.x, + 50 / flowchart.Zoom - flowchart.ScrollPos.y); CreateBlock(flowchart, newNodePosition); } + + // Separator + GUILayout.Label("", EditorStyles.toolbarButton, GUILayout.Width(8)); - GUILayout.Space(8); + GUILayout.Label("Scale", EditorStyles.miniLabel); + var newZoom = GUILayout.HorizontalSlider( + flowchart.Zoom, minZoomValue, maxZoomValue, GUILayout.MinWidth(40), GUILayout.MaxWidth(100) + ); + GUILayout.Label(flowchart.Zoom.ToString("0.0#x"), EditorStyles.miniLabel, GUILayout.Width(30)); + + if (GUILayout.Button("Min", EditorStyles.toolbarButton)) + { + newZoom = minZoomValue; + } + if (GUILayout.Button("Max", EditorStyles.toolbarButton)) + { + newZoom = maxZoomValue; + } - var newZoom = GUILayout.HorizontalSlider(flowchart.Zoom, minZoomValue, maxZoomValue, GUILayout.Width(100)); DoZoom(flowchart, newZoom - flowchart.Zoom, Vector2.one * 0.5f); + if (GUILayout.Button("Center", EditorStyles.toolbarButton)) + { + flowchart.ScrollPos = flowchart.CenterPosition; + } + + GUILayout.FlexibleSpace(); + + GUILayout.EndHorizontal(); + + GUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.Label(flowchart.name, EditorStyles.whiteBoldLabel); + + GUILayout.Space(2); + if (flowchart.Description.Length > 0) { GUILayout.Label(flowchart.Description, EditorStyles.helpBox); @@ -188,14 +234,14 @@ namespace Fungus.EditorUtils GUILayout.EndHorizontal(); - GUILayout.FlexibleSpace(); - GUILayout.BeginHorizontal(); GUILayout.BeginVertical(GUILayout.Width(440)); GUILayout.FlexibleSpace(); + var rawMousePosition = Event.current.mousePosition; // mouse position outside of scrollview to test against toolbar rect + flowchart.VariablesScrollPos = GUILayout.BeginScrollView(flowchart.VariablesScrollPos, GUILayout.MaxHeight(position.height * 0.75f)); GUILayout.FlexibleSpace(); @@ -215,7 +261,8 @@ namespace Fungus.EditorUtils } if (Event.current.type == EventType.Repaint) { - mouseOverVariables = variableWindowRect.Contains(Event.current.mousePosition); + Rect toolbarRect = new Rect(0, 0, position.width, 18); + mouseOverVariables = variableWindowRect.Contains(Event.current.mousePosition) || toolbarRect.Contains(rawMousePosition); } GUILayout.EndScrollView(); @@ -430,10 +477,10 @@ namespace Fungus.EditorUtils // Draw selection box if (startSelectionBoxPosition.x >= 0 && startSelectionBoxPosition.y >= 0) - { - GUI.Box(selectionBox, "", (GUIStyle) "SelectionRect"); + { + GUI.Box(selectionBox, "", (GUIStyle) "SelectionRect"); forceRepaintCount = 6; - } + } } public virtual void CalcFlowchartCenter(Flowchart flowchart, Block[] blocks) @@ -457,8 +504,8 @@ namespace Fungus.EditorUtils Vector2 center = (min + max) * -0.5f; - center.x += position.width * 0.5f; - center.y += position.height * 0.5f; + center.x += position.width * 0.5f / flowchart.Zoom; + center.y += position.height * 0.5f / flowchart.Zoom; flowchart.CenterPosition = center; } @@ -471,16 +518,19 @@ namespace Fungus.EditorUtils switch (Event.current.type) { case EventType.MouseDown: - startSelectionBoxPosition = Event.current.mousePosition; - mouseDownSelectionState = new List(flowchart.SelectedBlocks); - Event.current.Use(); + if (!mouseOverVariables) + { + startSelectionBoxPosition = Event.current.mousePosition; + mouseDownSelectionState = new List(flowchart.SelectedBlocks); + Event.current.Use(); + } break; case EventType.MouseDrag: if (startSelectionBoxPosition.x >= 0 && startSelectionBoxPosition.y >= 0) { var topLeft = Vector2.Min(startSelectionBoxPosition, Event.current.mousePosition); - var bottomRight = Vector2.Max(startSelectionBoxPosition, Event.current.mousePosition); + var bottomRight = Vector2.Max(startSelectionBoxPosition, Event.current.mousePosition); selectionBox = Rect.MinMaxRect(topLeft.x, topLeft.y, bottomRight.x, bottomRight.y); Rect zoomSelectionBox = selectionBox; From b1004a79c2cfadd393216e01a9b6daf26ab41828 Mon Sep 17 00:00:00 2001 From: Zach Vinless Date: Thu, 3 Nov 2016 22:56:28 -0700 Subject: [PATCH 2/8] Added null checks to flowchart window reflection code in case of breaking updates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added null checks to getting the “docked” property of the flowchart window in case this property gets changed or removed in the future. The default offset values should still be acceptable. --- .../Fungus/Scripts/Editor/FlowchartWindow.cs | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs index 926fe4aa..dab3d850 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs @@ -95,16 +95,24 @@ namespace Fungus.EditorUtils // The docked value doesn't always report correctly without the delayCall EditorApplication.delayCall += () => { var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - var isDockedMethod = typeof(EditorWindow).GetProperty("docked", flags).GetGetMethod(true); - if ((bool) isDockedMethod.Invoke(this, null)) - { - EditorZoomArea.Offset = new Vector2(2.0f, 19.0f); - } - else + var dockedProperty = typeof(EditorWindow).GetProperty("docked", flags); + + if (dockedProperty != null) { - EditorZoomArea.Offset = new Vector2(0.0f, 22.0f); + var isDockedMethod = dockedProperty.GetGetMethod(true); + if (isDockedMethod != null) + { + if ((bool) isDockedMethod.Invoke(this, null)) + { + EditorZoomArea.Offset = new Vector2(2.0f, 19.0f); + } + else + { + EditorZoomArea.Offset = new Vector2(0.0f, 22.0f); + } + } } - }; + }; } public static Flowchart GetFlowchart() From 79375f7055b5a5f900b2d2b731ea573d4cba1cb4 Mon Sep 17 00:00:00 2001 From: Zach Vinless Date: Fri, 4 Nov 2016 07:47:09 -0700 Subject: [PATCH 3/8] Removed flowchart min/max buttons and undid reflection null checks -Removed redundant min/max buttons in flowchart toolbar -Undid null checks from previous commit in favor of knowing about problems versus potential dead code --- .../Fungus/Scripts/Editor/FlowchartWindow.cs | 33 +++++-------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs index dab3d850..a0df30f9 100644 --- a/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs +++ b/Assets/Fungus/Scripts/Editor/FlowchartWindow.cs @@ -95,24 +95,16 @@ namespace Fungus.EditorUtils // The docked value doesn't always report correctly without the delayCall EditorApplication.delayCall += () => { var flags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance; - var dockedProperty = typeof(EditorWindow).GetProperty("docked", flags); - - if (dockedProperty != null) + var isDockedMethod = typeof(EditorWindow).GetProperty("docked", flags).GetGetMethod(true); + if ((bool) isDockedMethod.Invoke(this, null)) { - var isDockedMethod = dockedProperty.GetGetMethod(true); - if (isDockedMethod != null) - { - if ((bool) isDockedMethod.Invoke(this, null)) - { - EditorZoomArea.Offset = new Vector2(2.0f, 19.0f); - } - else - { - EditorZoomArea.Offset = new Vector2(0.0f, 22.0f); - } - } + EditorZoomArea.Offset = new Vector2(2.0f, 19.0f); + } + else + { + EditorZoomArea.Offset = new Vector2(0.0f, 22.0f); } - }; + }; } public static Flowchart GetFlowchart() @@ -205,15 +197,6 @@ namespace Fungus.EditorUtils ); GUILayout.Label(flowchart.Zoom.ToString("0.0#x"), EditorStyles.miniLabel, GUILayout.Width(30)); - if (GUILayout.Button("Min", EditorStyles.toolbarButton)) - { - newZoom = minZoomValue; - } - if (GUILayout.Button("Max", EditorStyles.toolbarButton)) - { - newZoom = maxZoomValue; - } - DoZoom(flowchart, newZoom - flowchart.Zoom, Vector2.one * 0.5f); if (GUILayout.Button("Center", EditorStyles.toolbarButton)) From 0504eb36515c8341e8061a322ddeeebc0d25602a Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 7 Nov 2016 11:19:14 +0000 Subject: [PATCH 4/8] Change CSVParser to use Regex.Split (way faster) --- .../Fungus/Thirdparty/CSVParser/CsvParser.cs | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs b/Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs index ffc59201..aa70df58 100644 --- a/Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs +++ b/Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Text; +using System.Text.RegularExpressions; namespace Ideafixxxer.CsvParser { @@ -190,28 +191,36 @@ namespace Ideafixxxer.CsvParser var context = new ParserContext(); // Handle both Windows and Mac line endings - string[] lines = csvData.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries); + var lines = Regex.Split(csvData, "\n|\r\n"); ParserState currentState = ParserState.LineStartState; - foreach (string next in lines) - { - foreach (char ch in next) + for (int i = 0; i < lines.Length; i++) { + var next = lines [i]; + + // Skip empty entries + if (next.Length == 0) { - switch (ch) - { + continue; + } + + for (int j = 0; j < next.Length; j++) { + var ch = next [j]; + + switch (ch) { case CommaCharacter: - currentState = currentState.Comma(context); + currentState = currentState.Comma (context); break; case QuoteCharacter: - currentState = currentState.Quote(context); + currentState = currentState.Quote (context); break; default: - currentState = currentState.AnyChar(ch, context); + currentState = currentState.AnyChar (ch, context); break; } } - currentState = currentState.EndOfLine(context); + currentState = currentState.EndOfLine (context); } + List allLines = context.GetAllLines(); return allLines.ToArray(); } From 3382bbf92fc03c0ffeee46a51839dfa0ffbc0a8d Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 7 Nov 2016 14:31:00 +0000 Subject: [PATCH 5/8] Increased height of multi-line text box for StringDataMulti --- Assets/Fungus/Scripts/VariableTypes/StringVariable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/Fungus/Scripts/VariableTypes/StringVariable.cs b/Assets/Fungus/Scripts/VariableTypes/StringVariable.cs index efb8c4a5..ef0ec2cf 100644 --- a/Assets/Fungus/Scripts/VariableTypes/StringVariable.cs +++ b/Assets/Fungus/Scripts/VariableTypes/StringVariable.cs @@ -96,7 +96,7 @@ namespace Fungus [VariableProperty("", typeof(StringVariable))] public StringVariable stringRef; - [TextArea(1,10)] + [TextArea(1,15)] [SerializeField] public string stringVal; From 9ae056a7699b0f76fd44202dfb780f1ff5f485de Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 7 Nov 2016 14:44:16 +0000 Subject: [PATCH 6/8] Fixed missing sprite assets in Asset Store version. --- .../FungusLua/Narrative/StageAndPortraits.unity | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Assets/FungusExamples/FungusLua/Narrative/StageAndPortraits.unity b/Assets/FungusExamples/FungusLua/Narrative/StageAndPortraits.unity index 53c51c9d..42a5f4a6 100644 --- a/Assets/FungusExamples/FungusLua/Narrative/StageAndPortraits.unity +++ b/Assets/FungusExamples/FungusLua/Narrative/StageAndPortraits.unity @@ -331,6 +331,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 574033268} + waitForFrames: 1 --- !u!114 &574033268 MonoBehaviour: m_ObjectHideFlags: 2 @@ -349,6 +350,8 @@ MonoBehaviour: y: 68.96694 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 0 blockName: Start description: @@ -381,7 +384,7 @@ MonoBehaviour: y: -340 width: 1114 height: 859 - selectedBlock: {fileID: 574033268} + selectedBlocks: [] selectedCommands: - {fileID: 574033272} variables: [] @@ -903,7 +906,7 @@ MonoBehaviour: nameColor: {r: 1, g: 1, b: 1, a: 1} soundEffect: {fileID: 0} portraits: - - {fileID: 21300000, guid: a92b08a118b7d46f59dd091acb2e4102, type: 3} + - {fileID: 21300000, guid: e8a9122c4dc10b14da3b625e1f2634c9, type: 3} - {fileID: 21300000, guid: 03bc547cc0049594bae51f00903eedef, type: 3} portraitsFace: 0 setSayDialog: {fileID: 1231398849} @@ -954,7 +957,7 @@ MonoBehaviour: soundEffect: {fileID: 0} portraits: - {fileID: 21300000, guid: 8f5b5b110e73a414eb229eeead86200f, type: 3} - - {fileID: 21300000, guid: c779e34c6eb8e45da98c70cf2802a54c, type: 3} + - {fileID: 21300000, guid: 84cdbfde1b7d4c24ab7071894480d5db, type: 3} portraitsFace: 0 setSayDialog: {fileID: 1958712152} description: From 6d3f14b4b94a4f8af8d6c26af3aeeefe5abcba55 Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 7 Nov 2016 14:45:19 +0000 Subject: [PATCH 7/8] Removed TestRunner game objects from DragAndDrop examples. --- .../DragAndDrop(EventSystem).unity | 60 ++++++------------- .../DragAndDrop/DragAndDrop.unity | 60 ++++++------------- 2 files changed, 36 insertions(+), 84 deletions(-) diff --git a/Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity b/Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity index 42fbfa00..d3e2421a 100644 --- a/Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity +++ b/Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity @@ -627,47 +627,6 @@ CircleCollider2D: m_PrefabParentObject: {fileID: 5800000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} m_PrefabInternal: {fileID: 442175927} ---- !u!1 &807929237 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 807929239} - - 114: {fileID: 807929238} - m_Layer: 0 - m_Name: TestRunner - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &807929238 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 807929237} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5c3afc1c624179749bcdecf7b0224902, type: 3} - m_Name: - m_EditorClassIdentifier: - currentTest: {fileID: 0} ---- !u!4 &807929239 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 807929237} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 10 --- !u!1 &1081858233 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} @@ -997,7 +956,7 @@ MonoBehaviour: y: -452 width: 1887 height: 1080 - selectedBlock: {fileID: 2019116698} + selectedBlocks: [] selectedCommands: - {fileID: 2019116697} variables: [] @@ -1030,6 +989,8 @@ MonoBehaviour: y: 29 width: 197 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 17 blockName: Drag Completed description: @@ -1240,6 +1201,8 @@ MonoBehaviour: y: 132 width: 197 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 16 blockName: Drag Exited description: @@ -1294,6 +1257,8 @@ MonoBehaviour: y: 133 width: 197 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 15 blockName: Drag Entered description: @@ -1332,6 +1297,8 @@ MonoBehaviour: y: 30 width: 136 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 14 blockName: Drag Cancelled description: @@ -1370,6 +1337,8 @@ MonoBehaviour: y: 27 width: 136 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 13 blockName: Drag Start description: @@ -1523,6 +1492,8 @@ MonoBehaviour: y: 29 width: 137 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 18 blockName: Object Clicked 1 description: @@ -1546,6 +1517,8 @@ MonoBehaviour: y: 31 width: 137 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 19 blockName: Object Clicked 2 description: @@ -1630,6 +1603,8 @@ MonoBehaviour: y: -50 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 20 blockName: Start description: @@ -1648,6 +1623,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 2019116698} + waitForFrames: 1 --- !u!1 &2096462794 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/FungusExamples/DragAndDrop/DragAndDrop.unity b/Assets/FungusExamples/DragAndDrop/DragAndDrop.unity index 1080282b..20d335cb 100644 --- a/Assets/FungusExamples/DragAndDrop/DragAndDrop.unity +++ b/Assets/FungusExamples/DragAndDrop/DragAndDrop.unity @@ -608,47 +608,6 @@ CircleCollider2D: m_PrefabParentObject: {fileID: 5800000, guid: 4442b79fcbcbb4aac97f42d6dc3d4e0b, type: 2} m_PrefabInternal: {fileID: 442175927} ---- !u!1 &807929237 -GameObject: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - serializedVersion: 4 - m_Component: - - 4: {fileID: 807929239} - - 114: {fileID: 807929238} - m_Layer: 0 - m_Name: TestRunner - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &807929238 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 807929237} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5c3afc1c624179749bcdecf7b0224902, type: 3} - m_Name: - m_EditorClassIdentifier: - currentTest: {fileID: 0} ---- !u!4 &807929239 -Transform: - m_ObjectHideFlags: 0 - m_PrefabParentObject: {fileID: 0} - m_PrefabInternal: {fileID: 0} - m_GameObject: {fileID: 807929237} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 10 --- !u!1 &1081858233 stripped GameObject: m_PrefabParentObject: {fileID: 100000, guid: 4d55f86cf3b124c8fb1158da26ffa96d, type: 2} @@ -979,7 +938,7 @@ MonoBehaviour: y: -452 width: 1887 height: 1080 - selectedBlock: {fileID: 2019116698} + selectedBlocks: [] selectedCommands: [] variables: [] description: 'This scene shows how to set up a drag-and-drop @@ -1011,6 +970,8 @@ MonoBehaviour: y: 29 width: 197 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 17 blockName: Drag Completed description: @@ -1221,6 +1182,8 @@ MonoBehaviour: y: 132 width: 197 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 16 blockName: Drag Exited description: @@ -1275,6 +1238,8 @@ MonoBehaviour: y: 133 width: 197 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 15 blockName: Drag Entered description: @@ -1313,6 +1278,8 @@ MonoBehaviour: y: 30 width: 136 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 14 blockName: Drag Cancelled description: @@ -1351,6 +1318,8 @@ MonoBehaviour: y: 27 width: 136 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 13 blockName: Drag Start description: @@ -1504,6 +1473,8 @@ MonoBehaviour: y: 29 width: 137 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 18 blockName: Object Clicked 1 description: @@ -1527,6 +1498,8 @@ MonoBehaviour: y: 31 width: 137 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 19 blockName: Object Clicked 2 description: @@ -1611,6 +1584,8 @@ MonoBehaviour: y: -50 width: 120 height: 40 + tint: {r: 1, g: 1, b: 1, a: 1} + useCustomTint: 0 itemId: 20 blockName: Start description: @@ -1629,6 +1604,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: parentBlock: {fileID: 2019116698} + waitForFrames: 1 --- !u!1 &2096462794 GameObject: m_ObjectHideFlags: 0 From 8d38ea62a780c7fac93219f8c0887db129b33812 Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 7 Nov 2016 14:47:21 +0000 Subject: [PATCH 8/8] Fixed onComplete callback in MusicManager.SetAudioVolume when duration is 0 --- Assets/Fungus/Scripts/Components/MusicManager.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/Fungus/Scripts/Components/MusicManager.cs b/Assets/Fungus/Scripts/Components/MusicManager.cs index 214fad29..bdae88c5 100644 --- a/Assets/Fungus/Scripts/Components/MusicManager.cs +++ b/Assets/Fungus/Scripts/Components/MusicManager.cs @@ -113,6 +113,10 @@ namespace Fungus if (Mathf.Approximately(duration, 0f)) { + if (onComplete != null) + { + onComplete(); + } audio.volume = volume; return; }