v3.5.0 Documentation
Getting Started

Follow these steps to get up and running with Fungus quickly, then learn more about what Fungus can do and how to do it from the other documentation pages and videos.

The Flowchart window

You'll need the Fungus Flowchart window when working with Fungus. Open and dock this window somewhere handy by following these steps:

  1. Choose menu: Tools | Fungus | Flowchart Window
1_menu.png
Menu open %Fungus window
  1. Drag-and-drop the Flowchart window to the location you wish to dock it:
2_window.png
Drag %Fungus window
  1. The Flowchart window is now docked and part of your Unity window layout:
3_docked.png
Docked %Fungus window

Example scenes

Two folders are created when you install Fungus, the Fungus features themslves (in folder 'Fungus') and a set of examples (in folder 'FungusExamples').

Examples include Drag and Drop, Sherlock and Fungus Town:

1_examples.png
%Fungus Examples

You can use the left-hand side of the Unity Project window to explore each example folder:

3_project_window.png
%Fungus Examples Project window

Alternatively, you can 'filter' the Project view to show all scenes (and no other files) by clicking the scene filter icon to the right of the search bar:

2_filter_scenes.png
%Fungus Examples Project window filter scenes

You can cancel the filter by clicking the 'x' in the search bar:

4_filter_scenes_cancel.png
%Fungus Examples Project window filter scenes cancel

Running the examples

To load an example scene, double click the desired example's scene object in the Project window, and the scene should load. For example, this screenshot shows the scene and Flowchart windows when the DragAndDrop example scene has been loaded:

5_drag_drop.png
%Fungus Examples Drag Drop

To run the currently loaded scene (i.e. to enter Play-mode), click the Unity 'play' triangle button at the center top of the Unity application window, and then do whatever makes sense in that scene (e..g click/type text/drag-and-drop objects etc.!):

6_drag_running.png
Unity play scene

Note: you click the 'play' button a second time to end Play-mode.

Playmode changes

As with all Unity projects, you can change the properties of gameObjects while a scene is running, but these changes are 'ephemeral' - they only last while the scene is running. As soon as you end play mode the properties of all objects in the Hierarchy will revert to those saved in the Scene file.

This makes it easy to 'tweak' values of objects in Play-mode, and then when the desired behaviour is achieved, those values can be set for the saved scene properties.

Values set when Unity is in Edit-mode will be saved when you saved your scene (CTRL-S / Command-S, or menu: File | Save Scene).

Playmode tint

Sometimes we can forget we are in Unity Play-mode, and then make changes to Hierarchy gameObject values that are then 'fogotton' when we do stop playing the scene. A good way to avoid this problem is to to set a 'tint' to the Unity editor to make it visually very clear to us when we are in Play-mode. To add a tint to Play-mode do the following:

  1. Open the Unity preferences dialog by choosing menu: File | Preferences ...
  2. Select the Colors preferences, and choose a light colored tint (we chose a light green in this case):
1_prefs_tint.png
Unity preferences dialog
  1. Close the dialog (changes are saved automatically).
  2. When you next enter Play-mode you'll see most of the Unity Editor windows turn green (apart from the Game and Flowchart windows):
2_green_play_mode.png
Unity Play Mode tinted

Creating a new scene

To create a new scene in Unity do the following:

  1. Choose menu: File | New Scene
  2. Note: if you have any unsaved changes for the current scene you need to either save or abandon them before a new scene can be created.
  3. You should now have a shiny new scene, with a Hierarchy containing just one gameObject, a Main Camera. The new scene will have been give the default name "Untitled", which you can see in the title of the Application window:
1_default.png
New Scene
  1. Good practice is to save your scene (in the right place, with the right name), before creating your work in the scene. Let's save this scene in the root of our project "Assets" folder, naming it "demo1". First choose menu: File | Save Scene As...
  2. Choose the location and name (we'll choose folders "Assets" and scene name "demo1"):
2_save_as.png
Save Scene As dialog
  1. Once you have successfully saved the scene you should now see the new scene file "demo1" in your Assets folder in the Project window, and you should also see in the Application window title that you are currently editing the scene named "demo1":
3_saved_scene.png
Editing newly saved scene

Menu: Tools | Fungus

The core Fungus operations are available from the Unity Tools menu.

Choose menu: Tools | Fungus to see the options available:

3_fungus_tools.png
%Fungus Tools menu

As can be seen, there are 2 submenus, Create and Utilities, plus the Flowchart Window action (which reveals the window if already open, or opens a new window if the Flowchart window was not previously opened).

Menu: Tools | Fungus | Create

The Fungus Tools Create submenu offers the following actions:

1_tools_create.png
%Fungus Tools Create menu

Menu: Tools | Fungus | Utilities

The Fungus Tools Utilties submenu offers the following actions:

2_tools_utilities.png
%Fungus Tools Utilities menu

Create a Flowchart

To create a Fungus Flowchart do the following:

  1. Choose menu: Tools | Fungus | Create Flowchart
1_tools_create.png
menu create Flowchart
  1. A new Flowchart gameObject should appear in the Hierarchy window.
2_flowchart_gameobject.png
new Flowchart gameobject
  1. Select the Flowchart gameObject in the Hierarchy window, and you'll see the Flowchart's properties in the Inspector Window:
3_flowchart_properties.png
Flowchart properties
  1. If you have not already displayed the Flowchart Window, you can do so by clicking the Flowchart Window button in the Inspector.
  2. As you can see, when a new Flowchat is created a single command Block named "New Block" is automatically created, with the Event handler "Game Started" (so it will start executing Fungus commands as soon as the scene goes into Play Mode).

Block properties

Let's change the name of the default command Block of a new Flowchart in the Flowchart window to "hello". Do the following:

  1. Create a new Fungus Flowchart (if you haven't already done so).
  2. Click to select the Block in the Flowchart window (when multiple blocks are present, the selected one gets a green highlight border).
  3. In the Inspector change the text for the Block Name property to "hello". You should see the Block name change in the Flowchart window:
1_rename.png
rename Block

Add a command

To add a "Say" command to a Block do the following:

  1. (setup) Create a new scene, add a Fungus Flowchart to the scene.
  2. Ensure the Block is selected, and you can see its properties in the Inspector, and ensure the name of the Block is "hello".
  3. Click the Plus button in the bottom half of the Inspector window, to add a new Command to the Block's properties:
1_plus.png
new command button
  1. Choose menu: Narrative | Say:
2_narrative_say.png
add Say command
  1. Since this Block only has one Command, that command is automatically selected (shown with a green highlight).
  2. In the "Story Text" textbox in the bottom half of the Inspector window type in "hello Fugus world":
3_hello_fungus_world.png
story text
  1. Run the scene, and see Fungus create a dialog window, and output the text contents of your Say command:
4_scene_running.png
story text output