// This code is part of the Fungus library (http://fungusgames.com) maintained by Chris Gregan (http://twitter.com/gofungus).
// It is released for free under the MIT open source license (https://github.com/snozbot/fungus/blob/master/LICENSE)
using UnityEngine;
using System.Collections;
using System.Text;
namespace Fungus
{
///
/// Options for using the Lua FungusModule.
///
public enum FungusModuleOptions
{
UseGlobalVariables, // Fungus helper items will be available as global variables.
UseFungusVariable, // Fungus helper items will be available in the 'fungus' global variable.
NoFungusModule // The fungus helper module will not be loaded.
}
public interface ILuaUtils
{
///
/// The currently selected language in the string table. Affects variable substitution.
///
string ActiveLanguage { get; set; }
///
/// Returns a string from the string table for this key.
/// The string returned depends on the active language.
///
string GetString(string key);
///
/// Implementation of StringSubstituter.ISubstitutionHandler
/// Substitutes specially formatted tokens in the text with global variables and string table values.
/// The string table value used depends on the currently loaded string table and active language.
///
bool SubstituteStrings(StringBuilder input);
///
/// Performs string substitution on the input string, replacing tokens of the form {$VarName} with
/// matching variables, localised strings, etc. in the scene.
///
string Substitute(string input);
///
/// Find a game object by name and returns it.
///
GameObject Find(string name);
///
/// Returns one active GameObject tagged tag. Returns null if no GameObject was found.
///
GameObject FindWithTag(string tag);
///
/// Returns a list of active GameObjects tagged tag. Returns empty array if no GameObject was found.
///
GameObject[] FindGameObjectsWithTag(string tag);
///
/// Create a copy of a GameObject.
/// Can be used to instantiate prefabs.
///
GameObject Instantiate(GameObject go);
///
/// Destroys an instance of a GameObject.
///
void Destroy(GameObject go);
///
/// Spawns an instance of a named prefab resource.
/// The prefab must exist in a Resources folder in the project.
///
GameObject Spawn(string resourceName);
///
/// Use the conversation manager to play out a conversation
///
///
IEnumerator DoConversation(string conv);
///
/// Sync the active say dialog with what Lua thinks the SayDialog should be
///
///
void SetSayDialog(SayDialog sayDialog);
}
}