Browse Source

Refactored LuaScript to use ILuaScript interface

master
Christopher 9 years ago
parent
commit
51849f65e5
  1. 16
      Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaScript.cs
  2. 12
      Assets/Fungus/Thirdparty/FungusLua/Scripts/ILuaScript.cs.meta
  3. 6
      Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaScript.cs

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

@ -0,0 +1,16 @@
using UnityEngine;
namespace Fungus
{
/// <summary>
/// Executes Lua script defined in a string property or in an external file.
/// </summary>
public interface ILuaScript
{
/// <summary>
/// Execute the Lua script.
/// This is the function to call if you want to trigger execution from an external script.
/// </summary>
void OnExecute();
}
}

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

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

6
Assets/Fungus/Thirdparty/FungusLua/Scripts/LuaScript.cs vendored

@ -62,7 +62,7 @@ namespace Fungus
return GetPath(current.parent) + "." + current.name;
}
public void Start()
protected virtual void Start()
{
InitLuaScript();
}
@ -128,6 +128,8 @@ namespace Fungus
return s;
}
#region ILuaScript implementation
/// <summary>
/// Execute the Lua script.
/// This is the function to call if you want to trigger execution from an external script.
@ -146,5 +148,7 @@ namespace Fungus
LuaEnv.RunLuaFunction(luaFunction, runAsCoroutine);
}
}
#endregion
}
}

Loading…
Cancel
Save