diff --git a/Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity b/Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity index ec325d08..d152b9f1 100644 --- a/Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity +++ b/Assets/FungusExamples/FungusLua/Narrative/NarrativeExample.unity @@ -13,7 +13,7 @@ SceneSettings: --- !u!104 &2 RenderSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 7 m_Fog: 0 m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} m_FogMode: 3 @@ -37,12 +37,12 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 6 + serializedVersion: 7 m_GIWorkflowMode: 1 - m_LightmapsMode: 1 m_GISettings: serializedVersion: 2 m_BounceScale: 1 @@ -53,17 +53,22 @@ LightmapSettings: m_EnableBakedLightmaps: 0 m_EnableRealtimeLightmaps: 0 m_LightmapEditorSettings: - serializedVersion: 3 + serializedVersion: 4 m_Resolution: 2 m_BakeResolution: 40 m_TextureWidth: 1024 m_TextureHeight: 1024 + m_AO: 0 m_AOMaxDistance: 1 - m_Padding: 2 m_CompAOExponent: 0 + m_CompAOExponentDirect: 0 + m_Padding: 2 m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 m_TextureCompression: 1 + m_DirectLightInLightProbes: 1 m_FinalGather: 0 + m_FinalGatherFiltering: 1 m_FinalGatherRayCount: 1024 m_ReflectionCompression: 2 m_LightingDataAsset: {fileID: 0} @@ -122,6 +127,7 @@ Transform: 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: 4 @@ -152,6 +158,7 @@ RectTransform: 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: 369768318} m_RootOrder: 0 @@ -228,6 +235,7 @@ RectTransform: 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: 1914784318} m_RootOrder: 0 @@ -300,6 +308,7 @@ RectTransform: 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: - {fileID: 269274606} m_Father: {fileID: 1262340433} @@ -383,7 +392,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -433,6 +442,7 @@ RectTransform: 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: 1225017618} m_RootOrder: 0 @@ -511,6 +521,7 @@ RectTransform: 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: - {fileID: 2008403089} m_Father: {fileID: 1262340433} @@ -594,7 +605,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -645,6 +656,7 @@ RectTransform: 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: - {fileID: 1245855837} - {fileID: 903888915} @@ -742,6 +754,7 @@ RectTransform: 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: 886771752} m_RootOrder: 0 @@ -818,6 +831,7 @@ RectTransform: 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: 903888915} m_RootOrder: 0 @@ -896,6 +910,7 @@ RectTransform: 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: - {fileID: 663108171} m_Father: {fileID: 1262340433} @@ -979,7 +994,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -1030,6 +1045,7 @@ RectTransform: 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: - {fileID: 879686982} m_Father: {fileID: 614649409} @@ -1154,6 +1170,7 @@ RectTransform: 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: 1594811189} m_RootOrder: 0 @@ -1255,6 +1272,7 @@ Transform: 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: 6 @@ -1287,6 +1305,7 @@ RectTransform: 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: - {fileID: 391726715} m_Father: {fileID: 1262340433} @@ -1370,7 +1389,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -1420,6 +1439,7 @@ RectTransform: 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: 1635249823} m_RootOrder: 0 @@ -1552,6 +1572,7 @@ Transform: 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 @@ -1582,6 +1603,7 @@ RectTransform: 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: 614649409} m_RootOrder: 0 @@ -1658,6 +1680,7 @@ RectTransform: 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: - {fileID: 369768318} - {fileID: 1225017618} @@ -1809,6 +1832,7 @@ MonoBehaviour: - key: menudialog obj: {fileID: 1851713324} component: {fileID: 1851713325} + showInherited: 0 --- !u!114 &1308476107 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1823,12 +1847,12 @@ MonoBehaviour: m_EditorClassIdentifier: luaEnvironment: {fileID: 1308476105} luaFile: {fileID: 0} - luaScript: "-- Lua functions are the equivalent of Blocks \n-- in a Fungus flowchart.\n\nsetsaydialog(saydialog)\nsetmenudialog(menudialog)\n\nfunction - start()\n say \"Welcome!\"\n\n sayoptions.waitforinput = false\n sayoptions.fadewhendone - = false\n\n say \"Select an option\"\n\n sayoptions.waitforinput = true\n - \ sayoptions.fadewhendone = true\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()" + luaScript: "setsaydialog(saydialog)\nsetmenudialog(menudialog)\n\nsay \"Welcome!\"\n\nsayoptions.waitforinput + = false\nsayoptions.fadewhendone = false\n\nsay \"Select an option\"\n\nsayoptions.waitforinput + = true\nsayoptions.fadewhendone = true\n\n-- choose() takes a single table parameter + (note the curly brackets!)\n\nlocal choice = choose{ \"Option A\", \"Option B\" + }\n\nif choice == 1 then\n say \"You chose option a\"\nelseif choice == 2 then\n + \ say \"You chose option b\"\nend\n" runAsCoroutine: 1 --- !u!114 &1308476108 MonoBehaviour: @@ -1860,6 +1884,7 @@ Transform: 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: 3 @@ -1975,10 +2000,8 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: clickMode: 1 - keyPressMode: 2 - shiftKeyEnabled: 1 nextClickDelay: 0 - keyList: 0900000020000000 + cancelEnabled: 1 ignoreMenuClicks: 1 --- !u!114 &1531220780 MonoBehaviour: @@ -2122,6 +2145,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1728665701} m_Father: {fileID: 0} @@ -2160,6 +2184,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.9, y: 1, z: 1} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1914784318} m_Father: {fileID: 1262340433} @@ -2301,6 +2326,7 @@ RectTransform: 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: - {fileID: 1115157304} m_Father: {fileID: 1262340433} @@ -2384,7 +2410,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -2436,6 +2462,7 @@ RectTransform: 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: - {fileID: 1229497281} m_Father: {fileID: 1262340433} @@ -2519,7 +2546,7 @@ MonoBehaviour: m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} m_Name: m_EditorClassIdentifier: - m_Material: {fileID: 10754, guid: 0000000000000000e000000000000000, type: 0} + m_Material: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} m_Color: {r: 1, g: 1, b: 1, a: 0.8627451} m_RaycastTarget: 1 m_OnCullStateChanged: @@ -2649,6 +2676,7 @@ RectTransform: 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: - {fileID: 1738922797} - {fileID: 614649409} @@ -2687,6 +2715,7 @@ RectTransform: 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: 1728665701} m_RootOrder: 0 @@ -2807,6 +2836,7 @@ Transform: 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: 5 @@ -2842,6 +2872,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: ee8371d2b2fe14a9ca0a9465140027de, type: 3} m_Name: m_EditorClassIdentifier: + autoSelectFirstButton: 0 --- !u!114 &1851713326 MonoBehaviour: m_ObjectHideFlags: 0 @@ -2923,6 +2954,7 @@ RectTransform: m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0, y: 0, z: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_Children: - {fileID: 1262340433} m_Father: {fileID: 0} @@ -2957,6 +2989,7 @@ RectTransform: 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: - {fileID: 314696866} m_Father: {fileID: 1535711470} @@ -2993,6 +3026,7 @@ RectTransform: 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: 461615210} m_RootOrder: 0 diff --git a/Assets/FungusExamples/FungusLua/Narrative/Resources/Lua/junglestory.txt b/Assets/FungusExamples/FungusLua/Narrative/Resources/Lua/junglestory.txt index bda18149..817a69a1 100644 --- a/Assets/FungusExamples/FungusLua/Narrative/Resources/Lua/junglestory.txt +++ b/Assets/FungusExamples/FungusLua/Narrative/Resources/Lua/junglestory.txt @@ -25,28 +25,21 @@ function M.start() say "While we're here, I suggest we fill our canteens from this waterfall." - menu("Agreed", M.canteenyes) -- Show menu option, call M.canteenyes() if selected - menu("No, we don't have time", M.canteenno) -end - -function M.canteenyes() - runblock(flowchart, "PlayPourSound") - setcharacter(sherlockcharacter, "annoyed") - say "There, that's better" - - M.moveon() -- Call another function in the module -end - -function M.canteenno() - setcharacter(sherlockcharacter, "annoyed") - say "Let's get moving" - - M.moveon() -end - -function M.moveon() - setcharacter(sherlockcharacter, "annoyed") - say("There must be some way out of this cursed place.") + -- Show multiple options to the player + -- Note the last option is disabled but not selectable because of the ~ character. + local choice = choose { "Agreed", "No, we don't have time", "~Not interested" } + + if choice == 1 then + runblock(flowchart, "PlayPourSound") + setcharacter(sherlockcharacter, "annoyed") + say "There, that's better" + elseif choice == 2 then + setcharacter(sherlockcharacter, "annoyed") + say "Let's get moving" + end + + setcharacter(sherlockcharacter, "annoyed") + say("There must be some way out of this cursed place.") end return M