From e185e8d2aa02a53472cdced1ad6112e45ab08acd Mon Sep 17 00:00:00 2001 From: Chris Gregan Date: Thu, 5 May 2016 17:55:45 +0100 Subject: [PATCH] Renamed narrative test --- .../FungusExamples/FungusLua/Narrative.meta | 9 ++ .../NarrativeExample.unity} | 143 +++++++++++------- .../NarrativeExample.unity.meta} | 0 3 files changed, 99 insertions(+), 53 deletions(-) create mode 100644 Assets/FungusExamples/FungusLua/Narrative.meta rename Assets/FungusExamples/FungusLua/{Narrative.unity => Narrative/NarrativeExample.unity} (95%) rename Assets/FungusExamples/FungusLua/{Narrative.unity.meta => Narrative/NarrativeExample.unity.meta} (100%) diff --git a/Assets/FungusExamples/FungusLua/Narrative.meta b/Assets/FungusExamples/FungusLua/Narrative.meta new file mode 100644 index 00000000..30aee9bc --- /dev/null +++ b/Assets/FungusExamples/FungusLua/Narrative.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 39dccba44157a4764afec0335a7df616 +folderAsset: yes +timeCreated: 1462429277 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/FungusExamples/FungusLua/Narrative.unity b/Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity similarity index 95% rename from Assets/FungusExamples/FungusLua/Narrative.unity rename to Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity index a19e09e7..7cec53a9 100644 --- a/Assets/FungusExamples/FungusLua/Narrative.unity +++ b/Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity @@ -124,7 +124,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 3 --- !u!1 &269274605 GameObject: m_ObjectHideFlags: 0 @@ -648,8 +648,9 @@ MonoBehaviour: m_EditorClassIdentifier: luaEnvironment: {fileID: 0} luaFile: {fileID: 0} - luaScript: "setsaydialog(saydialog)\nsetmenudialog(menudialog)\n\nfunction start()\n - \ say \"Select an option\"\n\n menu(\"Option A\", optiona)\n menu(\"Option + luaScript: "-- Lua functions are the equivalent of Blocks \n-- in a Fungus flowchart.\n\nsetsaydialog(saydialog)\nsetmenudialog(menudialog)\n\nfunction + start()\n\n\n say \"Welcome!\"\n\n sayoptions.waitforinput = false\n sayoptions.fadewhendone + = false\n\n say \"Select an option\"\n\n menu(\"Option A\", optiona)\n menu(\"Option B\", optionb)\nend\n\nfunction optiona()\n say(\"You chose option a\")\nend\n\nfunction optionb()\n say(\"You chose option b\")\nend\n\nstart()\n" runAsCoroutine: 1 @@ -664,7 +665,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 5 --- !u!114 &519026842 MonoBehaviour: m_ObjectHideFlags: 0 @@ -684,6 +685,7 @@ MonoBehaviour: repeatEveryFrame: 1 hasFailed: 0 executeMethods: 2 + executeMethodName: OnExecute --- !u!1 &614649408 GameObject: m_ObjectHideFlags: 0 @@ -1270,6 +1272,61 @@ CanvasRenderer: type: 2} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1115157303} +--- !u!1 &1215182813 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 4 + m_Component: + - 4: {fileID: 1215182815} + - 114: {fileID: 1215182814} + m_Layer: 0 + m_Name: InfoText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1215182814 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1215182813} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8c0cbb63e218a4414a796a60ffe37dd3, type: 3} + m_Name: + m_EditorClassIdentifier: + info: 'This example shows how to use the say() and menu() Lua functions to create + a branching story. + + + In this example, we''ve added MenuDialog and SayDialog objects which you can customise. + These are bound in LuaBindings and activated using the setsaydialog() and setmenudialog() + functions in the LuaScript object. + + + If you don''t explicity create and register Say and Menu Dialogs like this then + default ones will automatically be created when you call the say() and menu() + functions. + + + The Menu dialogs require an Event System to be present in the scene. You can add + one using GameObject > UI > Event System if needed. ' +--- !u!4 &1215182815 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1215182813} + 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: 7 --- !u!1 &1225017617 GameObject: m_ObjectHideFlags: 0 @@ -1405,52 +1462,6 @@ CanvasRenderer: type: 2} m_PrefabInternal: {fileID: 0} m_GameObject: {fileID: 1225017617} ---- !u!1001 &1228394773 -Prefab: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 495584, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: m_RootOrder - value: 3 - objectReference: {fileID: 0} - - target: {fileID: 11486636, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - propertyPath: fungusModule - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_ParentPrefab: {fileID: 100100000, guid: 49031c561e16d4fcf91c12153f8e0b25, type: 2} - m_IsPrefabParent: 0 --- !u!1 &1229497280 GameObject: m_ObjectHideFlags: 0 @@ -1796,7 +1807,33 @@ MonoBehaviour: m_EditorClassIdentifier: tableName: registerTypes: 1 - boundTypes: [] + boundTypes: + - UnityEngine.GameObject, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.PrimitiveType, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Component, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - System.Type, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - UnityEngine.SendMessageOptions, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + - UnityEngine.SceneManagement.Scene, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + - UnityEngine.Object, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - System.Single, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - Fungus.SayDialog, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.AudioClip, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - System.Action, System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + - Fungus.Character, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - Fungus.Flowchart, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Sprite, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Color, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.UI.Button, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.Canvas, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.UI.Text, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.UI.Image, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + - Fungus.MenuDialog, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - Fungus.Block, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + - UnityEngine.UI.Slider, UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null boundObjects: - key: saydialog obj: {fileID: 1531220777} @@ -1815,7 +1852,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 4 --- !u!1 &1531220777 GameObject: m_ObjectHideFlags: 0 @@ -2762,7 +2799,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 6 --- !u!1 &1851713324 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/FungusExamples/FungusLua/Narrative.unity.meta b/Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity.meta similarity index 100% rename from Assets/FungusExamples/FungusLua/Narrative.unity.meta rename to Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity.meta