示例#1
0
        /// <summary>
        /// Execute the Lua script.
        /// This is the function to call if you want to trigger execution from an external script.
        /// </summary>
        public virtual void OnExecute()
        {
            // Make sure the script and Lua environment are initialised before executing
            InitLuaScript();

            if (LuaEnv == null)
            {
                Debug.LogWarning("No Lua Environment found");
            }
            else
            {
                LuaEnv.RunLuaFunction(luaFunction, runAsCoroutine);
            }
        }