Browse Source

Added Doxygen documentation support.

Fully documented all methods on GameController.cs
Documented all classes and most public functions.
master
chrisgregan 11 years ago
parent
commit
db7d44acda
  1. 40
      Assets/Fungus/Scripts/AnimationListener.cs
  2. 12
      Assets/Fungus/Scripts/Button.cs
  3. 19
      Assets/Fungus/Scripts/CameraController.cs
  4. 37
      Assets/Fungus/Scripts/CommandQueue.cs
  5. 100
      Assets/Fungus/Scripts/Commands.cs
  6. 6
      Assets/Fungus/Scripts/FixedHeightSprite.cs
  7. 48
      Assets/Fungus/Scripts/Game.cs
  8. 696
      Assets/Fungus/Scripts/GameController.cs
  9. 6
      Assets/Fungus/Scripts/GameState.cs
  10. 8
      Assets/Fungus/Scripts/Page.cs
  11. 17
      Assets/Fungus/Scripts/Room.cs
  12. 19
      Assets/Fungus/Scripts/RoomTemplate.cs
  13. 10
      Assets/Fungus/Scripts/SpriteFader.cs
  14. 114
      Assets/Fungus/Scripts/StringTable.cs
  15. 20
      Assets/Fungus/Scripts/StringsParser.cs
  16. 8
      Assets/Fungus/Scripts/View.cs
  17. BIN
      Assets/Fungus/Sprites/FungusSmall.png
  18. 45
      Assets/Fungus/Sprites/FungusSmall.png.meta
  19. 2387
      Doxyfile

40
Assets/Fungus/Scripts/AnimationListener.cs

@ -1,26 +1,32 @@
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using Fungus;
// Listens for animation events namespace Fungus
// Usage:
// 1. Attach this script to the animated sprite that you want to listen to for events.
// 2. Add an event on the animation timeline
// 3. Edit the event and choose the 'CallRoomMethod' function
// 4. In the string parameters box, enter the name of the method to call in the active Room's script.
public class AnimationListener : MonoBehaviour
{ {
// Handler method for animation events /**
// The string event parameter is used to call a named method on the active room class * Listener component to handle animation events.
void CallRoomMethod(string methodName) * Usage:
* 1. Attach this script to the animated sprite that you want to listen to for events.
* 2. Add an event on the animation timeline
* 3. Edit the event and choose the 'CallRoomMethod' function
* 4. In the string parameters box, enter the name of the method to call in the active Room's script.
*/
public class AnimationListener : MonoBehaviour
{ {
Room room = Game.GetInstance().activeRoom; /**
if (room == null) * Handler method for animation events.
* The string event parameter is used to call a named method on the active room class
*/
void CallRoomMethod(string methodName)
{ {
return; Room room = Game.GetInstance().activeRoom;
} if (room == null)
{
return;
}
CommandQueue commandQueue = Game.GetInstance().commandQueue; CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.CallCommandMethod(room.gameObject, methodName); commandQueue.CallCommandMethod(room.gameObject, methodName);
}
} }
} }

12
Assets/Fungus/Scripts/Button.cs

@ -5,8 +5,10 @@ using Fungus;
namespace Fungus namespace Fungus
{ {
// Simple button handler class. /**
// When the user taps on the button, the named method is called on ancestor game objects (if it exists). * Button click handler class for making sprites clickable.
* When the user taps on the sprite, an Action delegate method is called
*/
[RequireComponent (typeof (SpriteRenderer))] [RequireComponent (typeof (SpriteRenderer))]
[RequireComponent (typeof (Collider2D))] [RequireComponent (typeof (Collider2D))]
public class Button : MonoBehaviour public class Button : MonoBehaviour
@ -14,7 +16,11 @@ namespace Fungus
public Action buttonAction; public Action buttonAction;
public SpriteRenderer spriteRenderer; public SpriteRenderer spriteRenderer;
// Makes a sprite clickable by attaching a Button component (and BoxCollider2D if required) /**
* Makes a sprite clickable by attaching a Button component (and BoxCollider2D if required).
* @param _spriteRenderer The sprite to be made clickable
* @param _buttonAction An Action delegate method to call when the player clicks on the sprite
*/
public static void MakeButton(SpriteRenderer _spriteRenderer, Action _buttonAction) public static void MakeButton(SpriteRenderer _spriteRenderer, Action _buttonAction)
{ {
if (_spriteRenderer == null) if (_spriteRenderer == null)

19
Assets/Fungus/Scripts/CameraController.cs

@ -6,8 +6,10 @@ using Fungus;
namespace Fungus namespace Fungus
{ {
// Controller for main camera. /**
// Supports several types of camera transition including snap, pan & fade. * Controller for main camera.
* Supports several types of camera transition including snap, pan & fade.
*/
public class CameraController : MonoBehaviour public class CameraController : MonoBehaviour
{ {
Game game; Game game;
@ -94,7 +96,10 @@ namespace Fungus
} }
} }
// Position camera so sprite is centered and fills the screen /**
* Positions camera so sprite is centered and fills the screen.
* @param spriteRenderer The sprite to center the camera on
*/
public void CenterOnSprite(SpriteRenderer spriteRenderer) public void CenterOnSprite(SpriteRenderer spriteRenderer)
{ {
Sprite sprite = spriteRenderer.sprite; Sprite sprite = spriteRenderer.sprite;
@ -112,7 +117,9 @@ namespace Fungus
PanToView(view, 0, null); PanToView(view, 0, null);
} }
// Moves camera from current position to a target View over a period of time /**
* Moves camera from current position to a target View over a period of time.
*/
public void PanToView(View view, float duration, Action arriveAction) public void PanToView(View view, float duration, Action arriveAction)
{ {
if (duration == 0f) if (duration == 0f)
@ -166,7 +173,9 @@ namespace Fungus
} }
} }
// Moves camera smoothly through a sequence of Views over a period of time /**
* Moves camera smoothly through a sequence of Views over a period of time
*/
public void PanToPath(View[] viewList, float duration, Action arriveAction) public void PanToPath(View[] viewList, float duration, Action arriveAction)
{ {
List<Vector3> pathList = new List<Vector3>(); List<Vector3> pathList = new List<Vector3>();

37
Assets/Fungus/Scripts/CommandQueue.cs

@ -5,11 +5,15 @@ using System.Collections.Generic;
namespace Fungus namespace Fungus
{ {
// Manages a sequential list of commands. /**
// When a command completes, the next command is popped from the queue and exectuted. * Manages a sequential list of commands.
* When a command completes, the next command is popped from the queue and exectuted.
*/
public class CommandQueue : MonoBehaviour public class CommandQueue : MonoBehaviour
{ {
// Base class for commands used with the CommandQueue /**
* Base class for commands used with the CommandQueue.
*/
public abstract class Command public abstract class Command
{ {
public abstract void Execute(CommandQueue commandQueue, Action onComplete); public abstract void Execute(CommandQueue commandQueue, Action onComplete);
@ -17,20 +21,27 @@ namespace Fungus
List<Command> commandList = new List<Command>(); List<Command> commandList = new List<Command>();
// Adds a command to the queue for later execution /**
* Adds a command to the queue for later execution
* @param command A command object to add to the queue
*/
public virtual void AddCommand(Command command) public virtual void AddCommand(Command command)
{ {
commandList.Add(command); commandList.Add(command);
} }
// Clears all queued commands from the list /**
* Clears all queued commands from the list
*/
public virtual void Reset() public virtual void Reset()
{ {
commandList.Clear(); commandList.Clear();
} }
// Executes the first command in the queue. /**
// When this command completes, the next command in the queue is executed. * Executes the first command in the queue.
* When this command completes, the next command in the queue is executed.
*/
public virtual void Execute() public virtual void Execute()
{ {
if (commandList.Count == 0) if (commandList.Count == 0)
@ -46,8 +57,10 @@ namespace Fungus
}); });
} }
// Calls a named method on a game object to populate the command queue. /**
// The command queue is then executed. * Calls a named method on a game object to populate the command queue.
* The command queue is then executed.
*/
public void CallCommandMethod(GameObject target, string methodName) public void CallCommandMethod(GameObject target, string methodName)
{ {
Reset(); Reset();
@ -55,8 +68,10 @@ namespace Fungus
Execute(); Execute();
} }
// Calls an Action delegate method to populate the command queue. /**
// The command queue is then executed. * Calls an Action delegate method to populate the command queue.
* The command queue is then executed.
*/
public void CallCommandMethod(Action method) public void CallCommandMethod(Action method)
{ {
Reset(); Reset();

100
Assets/Fungus/Scripts/Commands.cs

@ -5,8 +5,10 @@ using System.Collections.Generic;
namespace Fungus namespace Fungus
{ {
// Call a delegate method on execution. /**
// This command can be used to schedule arbitrary script code. * Call a delegate method on execution.
* This command can be used to schedule arbitrary script code.
*/
public class CallCommand : CommandQueue.Command public class CallCommand : CommandQueue.Command
{ {
Action callAction; Action callAction;
@ -34,7 +36,9 @@ namespace Fungus
} }
} }
// Wait for a period of time /**
* Wait for a period of time.
*/
public class WaitCommand : CommandQueue.Command public class WaitCommand : CommandQueue.Command
{ {
float duration; float duration;
@ -59,8 +63,10 @@ namespace Fungus
} }
} }
// Sets the currently active view immediately. /**
// The main camera snaps to the active view. * Sets the currently active view immediately.
* The main camera snaps to the active view.
*/
public class SetViewCommand : CommandQueue.Command public class SetViewCommand : CommandQueue.Command
{ {
View view; View view;
@ -96,7 +102,9 @@ namespace Fungus
} }
} }
// Sets the currently active page for text rendering /**
* Sets the currently active page for text rendering.
*/
public class SetPageCommand : CommandQueue.Command public class SetPageCommand : CommandQueue.Command
{ {
Page page; Page page;
@ -116,7 +124,9 @@ namespace Fungus
} }
} }
// Sets the title text displayed at the top of the active page /**
* Sets the title text displayed at the top of the active page.
*/
public class TitleCommand : CommandQueue.Command public class TitleCommand : CommandQueue.Command
{ {
string titleText; string titleText;
@ -144,8 +154,10 @@ namespace Fungus
} }
} }
// Writes story text to the currently active page. /**
// A 'continue' button is displayed when the text has fully appeared. * Writes story text to the currently active page.
* A 'continue' button is displayed when the text has fully appeared.
*/
public class SayCommand : CommandQueue.Command public class SayCommand : CommandQueue.Command
{ {
string storyText; string storyText;
@ -169,8 +181,10 @@ namespace Fungus
} }
} }
// Adds an option button to the current list of options. /**
// Use the Choose command to display added options. * Adds an option button to the current list of options.
* Use the Choose command to display added options.
*/
public class AddOptionCommand : CommandQueue.Command public class AddOptionCommand : CommandQueue.Command
{ {
string optionText; string optionText;
@ -200,7 +214,9 @@ namespace Fungus
} }
} }
// Displays all previously added options. /**
* Displays all previously added options.
*/
public class ChooseCommand : CommandQueue.Command public class ChooseCommand : CommandQueue.Command
{ {
string chooseText; string chooseText;
@ -225,7 +241,9 @@ namespace Fungus
} }
} }
// Changes the active room to a different room /**
* Changes the active room to a different room
*/
public class MoveToRoomCommand : CommandQueue.Command public class MoveToRoomCommand : CommandQueue.Command
{ {
Room room; Room room;
@ -249,7 +267,9 @@ namespace Fungus
} }
} }
// Sets a global boolean flag value /**
* Sets a global boolean flag value
*/
public class SetFlagCommand : CommandQueue.Command public class SetFlagCommand : CommandQueue.Command
{ {
string key; string key;
@ -271,7 +291,9 @@ namespace Fungus
} }
} }
// Sets a global integer counter value /**
* Sets a global integer counter value
*/
public class SetCounterCommand : CommandQueue.Command public class SetCounterCommand : CommandQueue.Command
{ {
string key; string key;
@ -293,7 +315,9 @@ namespace Fungus
} }
} }
// Sets a global inventory count value /**
* Sets a global inventory count value
*/
public class SetInventoryCommand : CommandQueue.Command public class SetInventoryCommand : CommandQueue.Command
{ {
string key; string key;
@ -315,7 +339,9 @@ namespace Fungus
} }
} }
// Fades a sprite to a given alpha value over a period of time /**
* Fades a sprite to a given alpha value over a period of time
*/
public class FadeSpriteCommand : CommandQueue.Command public class FadeSpriteCommand : CommandQueue.Command
{ {
SpriteRenderer spriteRenderer; SpriteRenderer spriteRenderer;
@ -353,7 +379,9 @@ namespace Fungus
} }
} }
// Sets an animator trigger to change the animator state for an animated sprite /**
* Sets an animator trigger to change the animator state for an animated sprite
*/
public class SetAnimatorTriggerCommand : CommandQueue.Command public class SetAnimatorTriggerCommand : CommandQueue.Command
{ {
Animator animator; Animator animator;
@ -383,7 +411,9 @@ namespace Fungus
} }
} }
// Makes a sprite behave as a clickable button /**
* Makes a sprite behave as a clickable button
*/
public class AddButtonCommand : CommandQueue.Command public class AddButtonCommand : CommandQueue.Command
{ {
SpriteRenderer spriteRenderer; SpriteRenderer spriteRenderer;
@ -413,7 +443,9 @@ namespace Fungus
} }
} }
// Makes a sprite stop behaving as a clickable button /**
* Makes a sprite stop behaving as a clickable button
*/
public class RemoveButtonCommand : CommandQueue.Command public class RemoveButtonCommand : CommandQueue.Command
{ {
SpriteRenderer spriteRenderer; SpriteRenderer spriteRenderer;
@ -441,7 +473,9 @@ namespace Fungus
} }
} }
// Pans the camera to a view over a period of time. /**
* Pans the camera to a view over a period of time.
*/
public class PanToViewCommand : CommandQueue.Command public class PanToViewCommand : CommandQueue.Command
{ {
View view; View view;
@ -485,7 +519,9 @@ namespace Fungus
} }
} }
// Pans the camera through a sequence of views over a period of time. /**
* Pans the camera through a sequence of views over a period of time.
*/
public class PanToPathCommand : CommandQueue.Command public class PanToPathCommand : CommandQueue.Command
{ {
View[] views; View[] views;
@ -532,7 +568,9 @@ namespace Fungus
} }
} }
// Fades the camera to a view over a period of time. /**
* Fades the camera to a view over a period of time.
*/
public class FadeToViewCommand : CommandQueue.Command public class FadeToViewCommand : CommandQueue.Command
{ {
View view; View view;
@ -576,7 +614,9 @@ namespace Fungus
} }
} }
// Plays a music clip /**
* Plays a music clip
*/
public class PlayMusicCommand : CommandQueue.Command public class PlayMusicCommand : CommandQueue.Command
{ {
AudioClip audioClip; AudioClip audioClip;
@ -606,7 +646,9 @@ namespace Fungus
} }
} }
// Stops a music clip /**
* Stops a music clip
*/
public class StopMusicCommand : CommandQueue.Command public class StopMusicCommand : CommandQueue.Command
{ {
public override void Execute(CommandQueue commandQueue, Action onComplete) public override void Execute(CommandQueue commandQueue, Action onComplete)
@ -621,7 +663,9 @@ namespace Fungus
} }
} }
// Fades music volume to required level over a period of time /**
* Fades music volume to required level over a period of time
*/
public class SetMusicVolumeCommand : CommandQueue.Command public class SetMusicVolumeCommand : CommandQueue.Command
{ {
float musicVolume; float musicVolume;
@ -645,7 +689,9 @@ namespace Fungus
} }
} }
// Plays a sound effect once /**
* Plays a sound effect once
*/
public class PlaySoundCommand : CommandQueue.Command public class PlaySoundCommand : CommandQueue.Command
{ {
AudioClip audioClip; AudioClip audioClip;

6
Assets/Fungus/Scripts/FixedHeightSprite.cs

@ -3,8 +3,10 @@ using System.Collections;
namespace Fungus namespace Fungus
{ {
// Adjusts the scale of a sprite to fit into a fixed number of vertical world units /**
// This helps to keep room sprites neatly organised in the editor. * Adjusts the scale of a sprite to fit into a fixed number of vertical world units.
* This helps to keep room sprites neatly organised in the editor.
*/
[ExecuteInEditMode] [ExecuteInEditMode]
public class FixedHeightSprite : MonoBehaviour public class FixedHeightSprite : MonoBehaviour
{ {

48
Assets/Fungus/Scripts/Game.cs

@ -2,24 +2,59 @@ using UnityEngine;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
/**
* @mainpage notitle
* This is the code documentation for Fungus, a Unity 3D plugin created by Chris Gregan of Snozbot.
*
* @note For a list of all supported scripting commands, please see the Fungus.GameController class documentation.
*
* Refer to http://www.snozbot.com/fungus for more information about Fungus.
*/
/**
* @package Fungus An open source library for Unity 3D for creating graphic interactive fiction games.
*/
namespace Fungus namespace Fungus
{ {
// Manages global game state and movement between rooms /**
* Manages global game state and movement between rooms.
*/
public class Game : MonoBehaviour public class Game : MonoBehaviour
{ {
/**
* The currently active Room.
* Only one Room may be active at a time.
*/
public Room activeRoom; public Room activeRoom;
/**
* Automatically display links between connected Rooms.
*/
public bool showLinks = true; public bool showLinks = true;
/**
* Text to use on 'Continue' buttons
*/
public string continueText = "Continue"; public string continueText = "Continue";
/**
* Writing speed for page text.
*/
public int charactersPerSecond = 60; public int charactersPerSecond = 60;
// Fixed Z coordinate of camera /**
* Fixed Z coordinate of main camera.
*/
public float cameraZ = - 10f; public float cameraZ = - 10f;
public float fadeDuration = 1f; /**
* Time for transition to complete when moving to a different Room.
*/
public float roomFadeDuration = 1f;
/**
* Full screen texture used for screen fade effect
*/
public Texture2D fadeTexture; public Texture2D fadeTexture;
[HideInInspector] [HideInInspector]
@ -73,6 +108,9 @@ namespace Fungus
} }
} }
/**
* Moves player to a different room.
*/
public void MoveToRoom(Room room) public void MoveToRoom(Room room)
{ {
if (room == null) if (room == null)
@ -82,7 +120,7 @@ namespace Fungus
} }
// Fade out screen // Fade out screen
cameraController.Fade(0f, fadeDuration / 2f, delegate { cameraController.Fade(0f, roomFadeDuration / 2f, delegate {
activeRoom = room; activeRoom = room;
@ -91,7 +129,7 @@ namespace Fungus
activeRoom.gameObject.SendMessage("Enter"); activeRoom.gameObject.SendMessage("Enter");
// Fade in screen // Fade in screen
cameraController.Fade(1f, fadeDuration / 2f, null); cameraController.Fade(1f, roomFadeDuration / 2f, null);
}); });
} }
} }

696
Assets/Fungus/Scripts/GameController.cs

@ -1,267 +1,443 @@
using UnityEngine; using UnityEngine;
using System; using System;
using System.Collections; using System.Collections;
using Fungus;
// This facade class gives easy access to all game control namespace Fungus
// functionality available in Fungus
public class GameController : MonoBehaviour
{ {
// /**
// Synchronous methods * This class gives easy access to every scripting command available in Fungus.
// The following methods all execute immediately */
// public class GameController : MonoBehaviour
{
// Return true if the boolean flag for the key has been set to true #region General Methods
public bool GetFlag(string key)
{ /**
GameState state = Game.GetInstance().state; * Transitions from the current Room to another Room.
return state.GetFlag(key); * This method returns immediately but it queues an asynchronous command for later execution.
} * @param room The Room to transition to.
*/
// Returns the count value for the key public void MoveToRoom(Room room)
// Returns zero if no value has been set. {
public int GetCounter(string key) CommandQueue commandQueue = Game.GetInstance().commandQueue;
{ commandQueue.AddCommand(new MoveToRoomCommand(room));
GameState state = Game.GetInstance().state; }
return state.GetCounter(key);
} /**
* Wait for a period of time before executing the next command.
// Returns the inventory count value for the key * This method returns immediately but it queues an asynchronous command for later execution.
// Returns zero if no inventory count has been set. * @param duration The wait duration in seconds
public int GetInventory(string key) */
{ public void Wait(float duration)
GameState state = Game.GetInstance().state; {
return state.GetInventory(key); CommandQueue commandQueue = Game.GetInstance().commandQueue;
} commandQueue.AddCommand(new WaitCommand(duration));
}
// Returns true if the inventory count for the key is greater than zero
public bool HasInventory(string key) /**
{ * Call a delegate method provided by the client.
GameState state = Game.GetInstance().state; * Used to queue the execution of arbitrary code as part of a command sequeunce.
return (state.GetInventory(key) > 0); * This method returns immediately but it queues an asynchronous command for later execution.
} * @param callAction The Action delegate method to be called when the command executes.
*/
// public void Call(Action callAction)
// Asynchronous methods {
// The following methods all queue commands for later execution in strict serial order CommandQueue commandQueue = Game.GetInstance().commandQueue;
// commandQueue.AddCommand(new CallCommand(callAction));
}
// Wait for a period of time before executing the next command
public void Wait(float duration) #endregion
{ #region View Methods
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new WaitCommand(duration)); /**
} * Sets the currently active View immediately.
* The main camera snaps to the new active View. If the View contains a Page object, this Page becomes the active Page.
// Call a delegate method provided by the client * This method returns immediately but it queues an asynchronous command for later execution.
// Used to queue the execution of arbitrary code. * @param view The View object to make active
public void Call(Action callAction) */
{ public void SetView(View view)
CommandQueue commandQueue = Game.GetInstance().commandQueue; {
commandQueue.AddCommand(new CallCommand(callAction)); CommandQueue commandQueue = Game.GetInstance().commandQueue;
} commandQueue.AddCommand(new SetViewCommand(view));
}
// Sets the currently active view immediately.
// The main camera snaps to the active view. /**
public void SetView(View view) * Pans the camera to the target View over a period of time.
{ * The pan starts at the current camera position and performs a smoothed linear pan to the target View.
CommandQueue commandQueue = Game.GetInstance().commandQueue; * Command execution blocks until the pan completes. When the camera arrives at the target View, this View becomes the active View.
commandQueue.AddCommand(new SetViewCommand(view)); * This method returns immediately but it queues an asynchronous command for later execution.
} * @param targetView The View to pan the camera to.
* @param duration The length of time in seconds needed to complete the pan.
// Sets the currently active page for text rendering */
public void SetPage(Page page) public void PanToView(View targetView, float duration)
{ {
CommandQueue commandQueue = Game.GetInstance().commandQueue; CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new SetPageCommand(page)); commandQueue.AddCommand(new PanToViewCommand(targetView, duration));
} }
// Sets the title text displayed at the top of the active page /**
public void Title(string titleText) * Pans the camera through a sequence of target Views over a period of time.
{ * The pan starts at the current camera position and performs a smooth pan through all Views in the list.
CommandQueue commandQueue = Game.GetInstance().commandQueue; * Command execution blocks until the pan completes. When the camera arrives at the last View in the list, this View becomes the active View.
commandQueue.AddCommand(new TitleCommand(titleText)); * If more control is required over the camera path then you should instead use an Animator component to precisely control the Camera path.
} * This method returns immediately but it queues an asynchronous command for later execution.
* @param duration The length of time in seconds needed to complete the pan.
// Writes story text to the currently active page. * @param targetViews A parameter list of views to visit during the pan.
// A 'continue' button is displayed when the text has fully appeared. */
public void Say(string storyText) public void PanToPath(float duration, params View[] targetViews)
{ {
CommandQueue commandQueue = Game.GetInstance().commandQueue; CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new SayCommand(storyText)); commandQueue.AddCommand(new PanToPathCommand(targetViews, duration));
} }
// Adds an option button to the current list of options. /**
// Use the Choose command to display added options. * Fades out the current camera View, and fades in again using the target View.
public void AddOption(string optionText, Action optionAction) * If the target View contains a Page object, this Page becomes the active Page.
{ * This method returns immediately but it queues an asynchronous command for later execution.
CommandQueue commandQueue = Game.GetInstance().commandQueue; * @param targetView The View object to fade to.
commandQueue.AddCommand(new AddOptionCommand(optionText, optionAction)); * @param duration The length of time in seconds needed to complete the pan.
} */
public void FadeToView(View targetView, float duration)
// Display all previously added options as buttons, with no text prompt {
public void Choose() CommandQueue commandQueue = Game.GetInstance().commandQueue;
{ commandQueue.AddCommand(new FadeToViewCommand(targetView, duration));
Choose(""); }
}
#endregion
// Displays a text prompt, followed by all previously added options as buttons. #region Page Methods
public void Choose(string chooseText)
{ /**
CommandQueue commandQueue = Game.GetInstance().commandQueue; * Sets the title text displayed at the top of the active Page.
commandQueue.AddCommand(new ChooseCommand(chooseText)); * The title text is only displayed when there is some story text or options to be shown.
} * This method returns immediately but it queues an asynchronous command for later execution.
* @param titleText The text to display as the title of the Page.
// Changes the active room to a different room */
public void MoveToRoom(Room room) public void Title(string titleText)
{ {
CommandQueue commandQueue = Game.GetInstance().commandQueue; CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new MoveToRoomCommand(room)); commandQueue.AddCommand(new TitleCommand(titleText));
} }
// Sets a global boolean flag value /**
public void SetFlag(string key, bool value) * Sets the currently active Page for story text display.
{ * Once this command executes, all story text added using Say(), AddOption(), Choose(), etc. will be displayed on this Page.
CommandQueue commandQueue = Game.GetInstance().commandQueue; * When a Room contains multiple Page objects, this method can be used to control which Page object is active at a given time.
commandQueue.AddCommand(new SetFlagCommand(key, value)); * This method returns immediately but it queues an asynchronous command for later execution.
} * @param page The Page object to make active
*/
// Sets a global integer counter value public void SetPage(Page page)
public void SetCounter(string key, int value) {
{ CommandQueue commandQueue = Game.GetInstance().commandQueue;
CommandQueue commandQueue = Game.GetInstance().commandQueue; commandQueue.AddCommand(new SetPageCommand(page));
commandQueue.AddCommand(new SetCounterCommand(key, value)); }
}
/**
// Sets a global inventory count value * Writes story text to the currently active Page.
// Assumes that the count value is 1 (common case) * A 'continue' button is displayed when the text has fully appeared.
public void SetInventory(string key) * Command execution halts until the user chooses to continue.
{ * This method returns immediately but it queues an asynchronous command for later execution.
CommandQueue commandQueue = Game.GetInstance().commandQueue; * @param storyText The text to be written to the currently active Page.
commandQueue.AddCommand(new SetInventoryCommand(key, 1)); */
} public void Say(string storyText)
{
// Sets a global inventory count value CommandQueue commandQueue = Game.GetInstance().commandQueue;
public void SetInventory(string key, int value) commandQueue.AddCommand(new SayCommand(storyText));
{ }
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new SetInventoryCommand(key, value)); /**
} * Adds an option to the current list of player options.
* Use the Choose() method to display previously added options.
// Sets sprite alpha to 0 immediately * This method returns immediately but it queues an asynchronous command for later execution.
public void HideSprite(SpriteRenderer spriteRenderer) * @param optionText The text to be displayed for this option
{ * @param optionAction The Action delegate method to be called when the player selects the option
FadeSprite(spriteRenderer, 0, 0, Vector2.zero); */
} public void AddOption(string optionText, Action optionAction)
{
// Sets sprite alpha to 1 immediately CommandQueue commandQueue = Game.GetInstance().commandQueue;
public void ShowSprite(SpriteRenderer spriteRenderer) commandQueue.AddCommand(new AddOptionCommand(optionText, optionAction));
{ }
FadeSprite(spriteRenderer, 1, 0, Vector2.zero);
} /**
* Display all previously added options as buttons, with no text prompt.
// Fades a sprite to a given alpha value over a period of time * This method returns immediately but it queues an asynchronous command for later execution.
public void FadeSprite(SpriteRenderer spriteRenderer, float targetAlpha, float duration) */
{ public void Choose()
FadeSprite(spriteRenderer, targetAlpha, duration, Vector2.zero); {
} Choose("");
}
// Fades a sprite to a given alpha value over a period of time, and applies a sliding motion to the sprite transform
public void FadeSprite(SpriteRenderer spriteRenderer, float targetAlpha, float duration, Vector2 slideOffset) /**
{ * Displays a story text prompt, followed by all previously added options.
CommandQueue commandQueue = Game.GetInstance().commandQueue; * This method returns immediately but it queues an asynchronous command for later execution.
Color color = spriteRenderer.color; * @param chooseText The story text to be written above the list of options
color.a = targetAlpha; */
commandQueue.AddCommand(new FadeSpriteCommand(spriteRenderer, color, duration, slideOffset)); public void Choose(string chooseText)
} {
CommandQueue commandQueue = Game.GetInstance().commandQueue;
// Makes a sprite behave as a clickable button commandQueue.AddCommand(new ChooseCommand(chooseText));
public void AddButton(SpriteRenderer buttonSprite, Action buttonAction) }
{
CommandQueue commandQueue = Game.GetInstance().commandQueue; #endregion
commandQueue.AddCommand(new AddButtonCommand(buttonSprite, buttonAction)); #region State Methods
}
/**
// Makes a sprite stop behaving as a clickable button * Sets a boolean flag value.
public void RemoveButton(SpriteRenderer buttonSprite) * This method returns immediately but it queues an asynchronous command for later execution.
{ * @param key The name of the flag
CommandQueue commandQueue = Game.GetInstance().commandQueue; * @param value The boolean value to set the flag to
commandQueue.AddCommand(new RemoveButtonCommand(buttonSprite)); */
} public void SetFlag(string key, bool value)
{
// Sets an animator trigger to change the animation state for an animated sprite CommandQueue commandQueue = Game.GetInstance().commandQueue;
public void SetAnimatorTrigger(Animator animator, string triggerName) commandQueue.AddCommand(new SetFlagCommand(key, value));
{ }
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new SetAnimatorTriggerCommand(animator, triggerName)); /**
} * Gets the current state of a flag.
* Flag values are set using SetFlag().
// Pans the camera to the target view over a period of time * Returns false if the flag has previously been set to false, or has not yet been set.
public void PanToView(View targetView, float duration) * @param key The name of the flag
{ * @return The boolean state of the flag.
CommandQueue commandQueue = Game.GetInstance().commandQueue; */
commandQueue.AddCommand(new PanToViewCommand(targetView, duration)); public bool GetFlag(string key)
} {
GameState state = Game.GetInstance().state;
// Pans the camera through a sequence of target views over a period of time return state.GetFlag(key);
public void PanToPath(float duration, params View[] targetViews) }
{
CommandQueue commandQueue = Game.GetInstance().commandQueue; /**
commandQueue.AddCommand(new PanToPathCommand(targetViews, duration)); * Sets an integer counter value.
} * This method returns immediately but it queues an asynchronous command for later execution.
* @param key The name of the counter
// Snaps the camera to the target view immediately * @param value The value to set the counter to
public void SnapToView(View targetView) */
{ public void SetCounter(string key, int value)
CommandQueue commandQueue = Game.GetInstance().commandQueue; {
commandQueue.AddCommand(new PanToViewCommand(targetView, 0f)); CommandQueue commandQueue = Game.GetInstance().commandQueue;
} commandQueue.AddCommand(new SetCounterCommand(key, value));
}
// Fades out the current camera view, and fades in again using the target view.
public void FadeToView(View targetView, float duration) /**
{ * Gets the current value of a counter.
CommandQueue commandQueue = Game.GetInstance().commandQueue; * Counter values are set using SetCounter().
commandQueue.AddCommand(new FadeToViewCommand(targetView, duration)); * Returns zero if the counter has not previously been set to a value.
} * @param key The name of the counter
* @return The current value of the counter
// Plays game music using an audio clip */
public void PlayMusic(AudioClip audioClip) public int GetCounter(string key)
{ {
CommandQueue commandQueue = Game.GetInstance().commandQueue; GameState state = Game.GetInstance().state;
commandQueue.AddCommand(new PlayMusicCommand(audioClip)); return state.GetCounter(key);
} }
// Stops playing game music /**
public void StopMusic() * Sets an inventory item count to 1.
{ * This supports the common case where the player can only collect 1 instance of an inventory item.
CommandQueue commandQueue = Game.GetInstance().commandQueue; * This method returns immediately but it queues an asynchronous command for later execution.
commandQueue.AddCommand(new StopMusicCommand()); * @param key The name of the inventory item
} */
public void SetInventory(string key)
// Sets music volume immediately {
public void SetMusicVolume(float musicVolume) CommandQueue commandQueue = Game.GetInstance().commandQueue;
{ commandQueue.AddCommand(new SetInventoryCommand(key, 1));
SetMusicVolume(musicVolume, 0f); }
}
/**
// Fades music volume to required level over a period of time * Sets the inventory count for an item.
public void SetMusicVolume(float musicVolume, float duration) * This method returns immediately but it queues an asynchronous command for later execution.
{ * @param key The name of the inventory item
CommandQueue commandQueue = Game.GetInstance().commandQueue; * @param value The inventory count for the item
commandQueue.AddCommand(new SetMusicVolumeCommand(musicVolume, duration)); */
} public void SetInventory(string key, int value)
{
// Plays a sound effect once CommandQueue commandQueue = Game.GetInstance().commandQueue;
public void PlaySound(AudioClip audioClip) commandQueue.AddCommand(new SetInventoryCommand(key, value));
{ }
PlaySound(audioClip, 1f);
} /**
* Gets the current inventory count for an item.
// Plays a sound effect once, at the specified volume * Inventory counts are set using SetInventory().
public void PlaySound(AudioClip audioClip, float volume) * Returns zero if the inventory count has not previously been set to a value.
{ * @param key The name of the inventory item
CommandQueue commandQueue = Game.GetInstance().commandQueue; * @return The current inventory count of the item
commandQueue.AddCommand(new PlaySoundCommand(audioClip, volume)); */
public int GetInventory(string key)
{
GameState state = Game.GetInstance().state;
return state.GetInventory(key);
}
/**
* Check if player has an inventory item.
* @param key The name of the inventory item
* @return Returns true if the inventory count for an item is greater than zero
*/
public bool HasInventory(string key)
{
GameState state = Game.GetInstance().state;
return (state.GetInventory(key) > 0);
}
#endregion
#region Sprite Methods
/**
* Makes a sprite completely transparent immediately.
* This changes the alpha component of the sprite renderer color to 0.
* This method returns immediately but it queues an asynchronous command for later execution.
* @param spriteRenderer The sprite to be modified
*/
public void HideSprite(SpriteRenderer spriteRenderer)
{
FadeSprite(spriteRenderer, 0, 0, Vector2.zero);
}
/**
* Makes a sprite completely opaque immediately.
* This changes the alpha component of the sprite renderer color to 1.
* This method returns immediately but it queues an asynchronous command for later execution.
* @param spriteRenderer The sprite to be modified
*/
public void ShowSprite(SpriteRenderer spriteRenderer)
{
FadeSprite(spriteRenderer, 1, 0, Vector2.zero);
}
/**
* Fades the transparency of a sprite over a period of time.
* This method returns immediately but it queues an asynchronous command for later execution.
* @param spriteRenderer The sprite to be modified
* @param targetAlpha The final required transparency value [0..1]
* @param duration The duration of the fade transition in seconds
*/
public void FadeSprite(SpriteRenderer spriteRenderer, float targetAlpha, float duration)
{
FadeSprite(spriteRenderer, targetAlpha, duration, Vector2.zero);
}
/**
* Fades the transparency of a sprite over a period of time, and applies a sliding motion to the sprite's position.
* The sprite starts at a position calculated by adding the current sprite position + the slide offset.
* The sprite then smoothly moves from this starting position to the original position of the sprite.
* Automatically adds a SpriteFader component to the sprite object to perform the transition.
* This method returns immediately but it queues an asynchronous command for later execution.
* @param spriteRenderer The sprite to be modified
* @param targetAlpha The final required transparency value [0..1]
* @param duration The duration of the fade transition in seconds
* @param slideOffset Offset to the starting position for the slide effect.
*/
public void FadeSprite(SpriteRenderer spriteRenderer, float targetAlpha, float duration, Vector2 slideOffset)
{
CommandQueue commandQueue = Game.GetInstance().commandQueue;
Color color = spriteRenderer.color;
color.a = targetAlpha;
commandQueue.AddCommand(new FadeSpriteCommand(spriteRenderer, color, duration, slideOffset));
}
/**
* Makes a sprite behave as a clickable button.
* Automatically adds a Button component to the object to respond to player input.
* If no Collider2D already exists on the object, then a BoxCollider2D is automatically added.
* Use RemoveButton() to make a sprite non-clickable again.
* This method returns immediately but it queues an asynchronous command for later execution.
* @param spriteRenderer The sprite to be made clickable
* @param buttonAction The Action delegate method to be called when the player clicks on the button
*/
public void AddButton(SpriteRenderer spriteRenderer, Action buttonAction)
{
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new AddButtonCommand(spriteRenderer, buttonAction));
}
/**
* Makes a sprite stop behaving as a clickable button.
* Removes the Button component from the sprite object.
* This method returns immediately but it queues an asynchronous command for later execution.
* @param spriteRenderer The sprite to be made non-clickable
*/
public void RemoveButton(SpriteRenderer spriteRenderer)
{
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new RemoveButtonCommand(spriteRenderer));
}
/**
* Sets an animator trigger to change the animation state for an animated sprite.
* This is the primary method of controlling Unity animations from a Fungus command sequence.
* This method returns immediately but it queues an asynchronous command for later execution.
* @param animator The sprite to be made non-clickable
* @param triggerName Name of a trigger parameter in the animator controller
*/
public void SetAnimatorTrigger(Animator animator, string triggerName)
{
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new SetAnimatorTriggerCommand(animator, triggerName));
}
#endregion
#region Audio Methods
/**
* Plays game music using an audio clip.
* One music clip may be played at a time.
* @param audioClip The music clip to play
*/
public void PlayMusic(AudioClip audioClip)
{
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new PlayMusicCommand(audioClip));
}
/**
* Stops playing game music.
*/
public void StopMusic()
{
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new StopMusicCommand());
}
/**
* Sets the game music volume immediately.
* @param musicVolume The new music volume value [0..1]
*/
public void SetMusicVolume(float musicVolume)
{
SetMusicVolume(musicVolume, 0f);
}
/**
* Fades the game music volume to required level over a period of time.
* @param musicVolume The new music volume value [0..1]
* @param duration The length of time in seconds needed to complete the volume change.
*/
public void SetMusicVolume(float musicVolume, float duration)
{
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new SetMusicVolumeCommand(musicVolume, duration));
}
/**
* Plays a sound effect once.
* Multiple sound effects can be played at the same time.
* @param audioClip The sound effect clip to play
*/
public void PlaySound(AudioClip audioClip)
{
PlaySound(audioClip, 1f);
}
/**
* Plays a sound effect once, at the specified volume.
* Multiple sound effects can be played at the same time.
* @param audioClip The sound effect clip to play
* @param volume The volume level of the sound effect
*/
public void PlaySound(AudioClip audioClip, float volume)
{
CommandQueue commandQueue = Game.GetInstance().commandQueue;
commandQueue.AddCommand(new PlaySoundCommand(audioClip, volume));
}
#endregion
} }
} }

6
Assets/Fungus/Scripts/GameState.cs

@ -4,8 +4,10 @@ using System.Collections.Generic;
namespace Fungus namespace Fungus
{ {
// Manages the global state information for the game /**
// This is implemented as a separate class to support saving and loading game state easily. * Manages the global state information for the game.
* Implemented as a separate class from Game to facilitate storing & restoring of game state.
*/
public class GameState public class GameState
{ {
protected Dictionary<string, bool> flags = new Dictionary<string, bool>(); protected Dictionary<string, bool> flags = new Dictionary<string, bool>();

8
Assets/Fungus/Scripts/Page.cs

@ -6,9 +6,11 @@ using System.Text.RegularExpressions;
namespace Fungus namespace Fungus
{ {
// A rectangular screen area for rendering story text. /**
// Rooms may contain any number of Pages. * A rectangular screen area for rendering story text.
// If a Page is a child of a View, then transitiong to that View will automatically activate the Page. * Rooms may contain any number of Pages.
* If a Page is a child of a View, then transitioning to that View will automatically activate the Page.
*/
[ExecuteInEditMode] [ExecuteInEditMode]
public class Page : MonoBehaviour public class Page : MonoBehaviour
{ {

17
Assets/Fungus/Scripts/Room.cs

@ -7,15 +7,22 @@ using Fungus;
namespace Fungus namespace Fungus
{ {
// This is the main scripting interface for Fungus games. /**
// Each room in your game should have a script which inherits from Room. * This is the primary base class for scripting Fungus games.
// The OnEnter() method is called when the player enters the room. * Each Room in your game should have a script component which inherits from Room.
// The GameController base class provides easy access to all story control commands * The OnEnter() method is called when the player enters the room.
* The GameController base class provides easy access to all Fungus functionality.
*/
public abstract class Room : GameController public abstract class Room : GameController
{ {
/**
* Number of times player has entered the room
*/
public int visitCount; public int visitCount;
// Returns true if this is the first time the player has visited this room /**
* Returns true if this is the first time the player has visited this room.
*/
public bool IsFirstVisit() public bool IsFirstVisit()
{ {
return (visitCount == 0); return (visitCount == 0);

19
Assets/Fungus/Scripts/RoomTemplate.cs

@ -2,13 +2,14 @@
using System.Collections; using System.Collections;
using Fungus; using Fungus;
// Use this class as a starting point for your own room scripts. /**
// 1. Select this script in the Project window in Unity3D/ * This class is a template to use as a starting point for your own Room scripts.
// 2. Choose Edit > Duplicate from the menu. A copy of the file will be created. * 1. Select this script in the Project window in Unity3D
// 3. Rename the file to match the name of your room (e.g. DungeonRoom) * 2. Choose Edit > Duplicate from the menu. A copy of the file will be created.
// 4. Edit the script and rename the class to match the file name (e.g. public class RoomTemplate => public class DungeonRoom) * 3. Rename the file to match the name of your room (e.g. DungeonRoom)
// 5. Save the script and add it as a component to your Room game object in Unity 3D. * 4. Edit the script and rename the class to match the file name (e.g. public class RoomTemplate => public class DungeonRoom)
* 5. Save the script and add it as a component to your Room game object in Unity 3D.
*/
public class RoomTemplate : Room public class RoomTemplate : Room
{ {
// Add public properties here. // Add public properties here.
@ -22,7 +23,9 @@ public class RoomTemplate : Room
// public Animator characterAnim; // public Animator characterAnim;
// public AudioClip musicClip; // public AudioClip musicClip;
// OnEnter() is always called when the player enters the room /**
* OnEnter() is always called when the player enters the room
*/
void OnEnter() void OnEnter()
{ {
// Add any sequence of Fungus commands you want here. // Add any sequence of Fungus commands you want here.

10
Assets/Fungus/Scripts/SpriteFader.cs

@ -3,8 +3,10 @@ using System.Collections;
namespace Fungus namespace Fungus
{ {
// Transitions a sprite from its current color to a target color. /**
// An offset can be applied to slide the sprite in while changing color. * Transitions a sprite from its current color to a target color.
* An offset can be applied to slide the sprite in while changing color.
*/
[RequireComponent (typeof (SpriteRenderer))] [RequireComponent (typeof (SpriteRenderer))]
public class SpriteFader : MonoBehaviour public class SpriteFader : MonoBehaviour
{ {
@ -17,7 +19,9 @@ namespace Fungus
SpriteRenderer spriteRenderer; SpriteRenderer spriteRenderer;
// Attaches a SpriteFader component to a sprite object to transition its color over time /**
* Attaches a SpriteFader component to a sprite object to transition its color over time.
*/
public static void FadeSprite(SpriteRenderer spriteRenderer, Color targetColor, float duration, Vector2 slideOffset) public static void FadeSprite(SpriteRenderer spriteRenderer, Color targetColor, float duration, Vector2 slideOffset)
{ {
if (spriteRenderer == null) if (spriteRenderer == null)

114
Assets/Fungus/Scripts/StringTable.cs

@ -3,69 +3,85 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
// Stores long or frequently repeated strings in a dictionary. namespace Fungus
// Strings can then be retrieved using a short key string.
public class StringTable
{ {
Dictionary<string, string> stringTable = new Dictionary<string, string>(); /**
* Stores long or frequently repeated strings in a dictionary.
public void ClearStringTable() * Strings can then be retrieved using a short key string.
*/
public class StringTable
{ {
stringTable.Clear(); Dictionary<string, string> stringTable = new Dictionary<string, string>();
}
// Retrieves a string from the table /**
public string GetString(string key) * Removes all strings from the string table.
{ */
if (stringTable.ContainsKey(key)) public void ClearStringTable()
{ {
return stringTable[key]; stringTable.Clear();
} }
return "";
}
// Adds or updates a string in the table
public void SetString(string key, string value)
{
stringTable[key] = value;
}
// Replace keys in the input string with the string table entry /**
// Example format: "This {string_key} string" * Retrieves a string from the table by key.
public string SubstituteStrings(string text) */
{ public string GetString(string key)
string subbedText = text; {
if (stringTable.ContainsKey(key))
{
return stringTable[key];
}
return "";
}
// Instantiate the regular expression object. /**
Regex r = new Regex("{.*?}"); * Adds or updates a string in the table.
*/
public void SetString(string key, string value)
{
stringTable[key] = value;
}
// Match the regular expression pattern against a text string. /**
var results = r.Matches(text); * Replace keys in the input string with the string table entry.
foreach (Match match in results) * Example format: "This {string_key} string"
*/
public string SubstituteStrings(string text)
{ {
string stringKey = match.Value.Substring(1, match.Value.Length - 2); string subbedText = text;
string stringValue = GetString(stringKey);
subbedText = subbedText.Replace(match.Value, stringValue); // Instantiate the regular expression object.
} Regex r = new Regex("{.*?}");
return subbedText; // Match the regular expression pattern against a text string.
} var results = r.Matches(text);
foreach (Match match in results)
{
string stringKey = match.Value.Substring(1, match.Value.Length - 2);
string stringValue = GetString(stringKey);
// Chops a string at the first new line character subbedText = subbedText.Replace(match.Value, stringValue);
// Useful for link / button strings that must fit on a single line }
public string FormatLinkText(string text)
{ return subbedText;
string trimmed;
if (text.Contains("\n"))
{
trimmed = text.Substring(0, text.IndexOf("\n"));
} }
else
/**
* Chops a string at the first new line character encountered.
* This is useful for link / button strings that must fit on a single line.
*/
public string FormatLinkText(string text)
{ {
trimmed = text; string trimmed;
} if (text.Contains("\n"))
{
trimmed = text.Substring(0, text.IndexOf("\n"));
}
else
{
trimmed = text;
}
return trimmed; return trimmed;
}
} }
} }

20
Assets/Fungus/Scripts/StringsParser.cs

@ -5,13 +5,15 @@ using System.Text.RegularExpressions;
namespace Fungus namespace Fungus
{ {
// Parses a text file in a simple format and adds string values to the global string table. /**
// The format is: * Parses a text file using a simple format and adds string values to the global string table.
// $FirstString * The format is:
// The first string text goes here * $FirstString
// $SecondString * The first string text goes here
// The second string text goes here * $SecondString
// # This is a comment line and will be ignored by the parser * The second string text goes here
* # This is a comment line and will be ignored by the parser
*/
public class StringsParser : MonoBehaviour public class StringsParser : MonoBehaviour
{ {
public TextAsset stringsFile; public TextAsset stringsFile;
@ -24,10 +26,10 @@ namespace Fungus
void Start() void Start()
{ {
StringsParser.ProcessText(stringsFile.text); ProcessText(stringsFile.text);
} }
static public void ProcessText(string text) void ProcessText(string text)
{ {
StringTable stringTable = Game.GetInstance().stringTable; StringTable stringTable = Game.GetInstance().stringTable;

8
Assets/Fungus/Scripts/View.cs

@ -3,9 +3,11 @@ using System.Collections;
namespace Fungus namespace Fungus
{ {
// Defines a camera view point. /**
// The position and rotation are specified using the game object's transform, so this class * Defines a camera view point.
// only specifies the ortographic view size. * The position and rotation are specified using the game object's transform, so this class
* only needs to specify the ortographic view size.
*/
[ExecuteInEditMode] [ExecuteInEditMode]
public class View : MonoBehaviour public class View : MonoBehaviour
{ {

BIN
Assets/Fungus/Sprites/FungusSmall.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

45
Assets/Fungus/Sprites/FungusSmall.png.meta

@ -0,0 +1,45 @@
fileFormatVersion: 2
guid: 901325229c7f9494b8810f5a5b8add9b
TextureImporter:
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: .25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 1024
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: .5, y: .5}
spritePixelsToUnits: 100
alphaIsTransparency: 0
textureType: -1
buildTargetSettings: []
spriteSheet:
sprites: []
spritePackingTag:
userData:

2387
Doxyfile

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save