Browse Source

Merge branch 'snozbot/master' into keyboard-shortcuts

master
Zach Vinless 8 years ago
parent
commit
dbba4ac381
  1. 4
      Assets/Fungus/Scripts/Components/MusicManager.cs
  2. 2
      Assets/Fungus/Scripts/VariableTypes/StringVariable.cs
  3. 29
      Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs
  4. 60
      Assets/FungusExamples/DragAndDrop/DragAndDrop(EventSystem).unity
  5. 60
      Assets/FungusExamples/DragAndDrop/DragAndDrop.unity
  6. 9
      Assets/FungusExamples/FungusLua/Narrative/StageAndPortraits.unity

4
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;
}

2
Assets/Fungus/Scripts/VariableTypes/StringVariable.cs

@ -96,7 +96,7 @@ namespace Fungus
[VariableProperty("<Value>", typeof(StringVariable))]
public StringVariable stringRef;
[TextArea(1,10)]
[TextArea(1,15)]
[SerializeField]
public string stringVal;

29
Assets/Fungus/Thirdparty/CSVParser/CsvParser.cs vendored

@ -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<string[]> allLines = context.GetAllLines();
return allLines.ToArray();
}

60
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

60
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

9
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:

Loading…
Cancel
Save