一.实现unity像挂载c#一样挂载lua脚本
using UnityEngine;
using System.Collections;
using Slua;
using System.Collections.Generic;
using DG.Tweening;
using System;
public class LuaItems:MonoBehaviour
{
[SerializeField]
public string luaPath;
[SerializeField]
public int paramsLen = 0;
[SerializeField]
public List<string> paramsList = new List<string>();
protected _luaTable;
public LuaTable luaTable
{
get
{
//LuaManger.luaSvr是slua自带的luastate封装
if(_luaTable == null && !string.IsNullOrEmpty(luaPath)&&LuaMgr.luaSvr != null)
{
_luaTable = LuaMgr.luaSvr.start(luaPath) as LuaTable
}
return _luaTable
}
}
protected LuaFunction _luaUpdateFun;
protected LuaFunction _luaFixUpdateFun;
protected LuaFunction _luaAwake;
protected LuaFunction _luaStartItem;
protected LuaFun