From 86bc9674744effd325b96f80a09265709ecbb30d Mon Sep 17 00:00:00 2001 From: Christopher Date: Mon, 12 Sep 2016 10:56:36 +0100 Subject: [PATCH] Refactored LuaBindings to use ILuaBindings interface --- .../Thirdparty/FungusLua/Scripts/ILuaBindings.cs | 16 ++++++++++++++++ .../FungusLua/Scripts/ILuaBindings.cs.meta | 12 ++++++++++++ .../Thirdparty/FungusLua/Scripts/LuaBindings.cs | 3 +-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs create mode 100644 Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs.meta diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs new file mode 100644 index 00000000..7dc112bc --- /dev/null +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs @@ -0,0 +1,16 @@ +using UnityEngine; +using System.Collections; + +namespace Fungus +{ + /// + /// Binds objects to identifiers in a Lua Environment. + /// + public interface ILuaBindings + { + /// + /// Add all declared bindings to the globals table. + /// + void AddBindings(ILuaEnvironment luaEnv); + } +} \ No newline at end of file diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs.meta b/Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs.meta new file mode 100644 index 00000000..b4a80db7 --- /dev/null +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaBindings.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 171f4567dbd354491adfd4d9b72bea9f +timeCreated: 1473671931 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs index c809a3f9..5b0aab3b 100644 --- a/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs +++ b/Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaBindings.cs @@ -13,7 +13,7 @@ namespace Fungus /// When the Lua Environment initialises, it finds all components in the scene that inherit /// from LuaBindingsBase and calls them to add their bindings. /// - public abstract class LuaBindingsBase : MonoBehaviour + public abstract class LuaBindingsBase : MonoBehaviour, ILuaBindings { /// /// Add all declared bindings to the globals table. @@ -43,7 +43,6 @@ namespace Fungus [Tooltip("The specific LuaEnvironment to register the bindings in.")] [SerializeField] protected LuaEnvironment luaEnvironment; - public ILuaEnvironment LuaEnv { get; set; } /// /// Name of global table variable to store bindings in. If left blank then each binding will be added as a global variable.