Browse Source

Refactored LuaBindings to use ILuaBindings interface

master
Christopher 9 years ago
parent
commit
86bc967474
  1. 16
      Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs
  2. 12
      Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs.meta
  3. 3
      Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs

16
Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs vendored

@ -0,0 +1,16 @@
using UnityEngine;
using System.Collections;
namespace Fungus
{
/// <summary>
/// Binds objects to identifiers in a Lua Environment.
/// </summary>
public interface ILuaBindings
{
/// <summary>
/// Add all declared bindings to the globals table.
/// </summary>
void AddBindings(ILuaEnvironment luaEnv);
}
}

12
Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs.meta vendored

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 171f4567dbd354491adfd4d9b72bea9f
timeCreated: 1473671931
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

3
Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs vendored

@ -13,7 +13,7 @@ namespace Fungus
/// When the Lua Environment initialises, it finds all components in the scene that inherit /// When the Lua Environment initialises, it finds all components in the scene that inherit
/// from LuaBindingsBase and calls them to add their bindings. /// from LuaBindingsBase and calls them to add their bindings.
/// </summary> /// </summary>
public abstract class LuaBindingsBase : MonoBehaviour public abstract class LuaBindingsBase : MonoBehaviour, ILuaBindings
{ {
/// <summary> /// <summary>
/// Add all declared bindings to the globals table. /// Add all declared bindings to the globals table.
@ -43,7 +43,6 @@ namespace Fungus
[Tooltip("The specific LuaEnvironment to register the bindings in.")] [Tooltip("The specific LuaEnvironment to register the bindings in.")]
[SerializeField] protected LuaEnvironment luaEnvironment; [SerializeField] protected LuaEnvironment luaEnvironment;
public ILuaEnvironment LuaEnv { get; set; }
/// <summary> /// <summary>
/// Name of global table variable to store bindings in. If left blank then each binding will be added as a global variable. /// Name of global table variable to store bindings in. If left blank then each binding will be added as a global variable.

Loading…
Cancel
Save