static int Focus(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); VisowFrameWork.LuaComponentGroup obj = (VisowFrameWork.LuaComponentGroup)ToLua.CheckObject <VisowFrameWork.LuaComponentGroup>(L, 1); bool arg0 = LuaDLL.luaL_checkboolean(L, 2); obj.Focus(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetLuaComponent(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); VisowFrameWork.LuaComponentGroup obj = (VisowFrameWork.LuaComponentGroup)ToLua.CheckObject <VisowFrameWork.LuaComponentGroup>(L, 1); string arg0 = ToLua.CheckString(L, 2); VisowFrameWork.LuaComponent o = obj.GetLuaComponent(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int set_content(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); VisowFrameWork.LuaComponent obj = (VisowFrameWork.LuaComponent)o; VisowFrameWork.LuaComponentGroup arg0 = (VisowFrameWork.LuaComponentGroup)ToLua.CheckObject <VisowFrameWork.LuaComponentGroup>(L, 2); obj.content = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index content on a nil value")); } }
static int get_content(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); VisowFrameWork.LuaComponent obj = (VisowFrameWork.LuaComponent)o; VisowFrameWork.LuaComponentGroup ret = obj.content; ToLua.Push(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index content on a nil value")); } }
static int get_luaComponenetName(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); VisowFrameWork.LuaComponentGroup obj = (VisowFrameWork.LuaComponentGroup)o; System.Collections.Generic.List <string> ret = obj.luaComponenetName; ToLua.PushSealed(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index luaComponenetName on a nil value")); } }
static int set_luaComponenetList(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); VisowFrameWork.LuaComponentGroup obj = (VisowFrameWork.LuaComponentGroup)o; System.Collections.Generic.List <VisowFrameWork.LuaComponent> arg0 = (System.Collections.Generic.List <VisowFrameWork.LuaComponent>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.List <VisowFrameWork.LuaComponent>)); obj.luaComponenetList = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o, "attempt to index luaComponenetList on a nil value")); } }
public override void OnInspectorGUI() { // LuaCOmponenetGroup实例 LuaComponentGroup luaGroup = target as LuaComponentGroup; base.OnInspectorGUI(); GUI.color = Color.red; GUILayout.Box("绑定区域:Lua脚本组件", GUILayout.ExpandWidth(true), GUILayout.Height(50)); GUI.color = Color.white; //如果鼠标正在拖拽中或拖拽结束时,并且鼠标所在位置在文本输入框内 EventType eventType = Event.current.type; if (eventType == EventType.DragUpdated || eventType == EventType.DragPerform) { DragAndDrop.visualMode = DragAndDropVisualMode.Copy; if (eventType == EventType.DragPerform) { DragAndDrop.AcceptDrag(); //改变鼠标的外表 string filePath = DragAndDrop.paths[0]; filePath = Application.dataPath + filePath.Replace("Assets", ""); Debug.Log("BindLuaComponent:" + filePath); if (File.Exists(filePath)) { string bandName = filePath.Replace(Application.dataPath + "/Game/Lua/", ""); bandName = bandName.Replace('/', '.'); bandName = bandName.Replace(".lua", ""); if (!luaGroup.luaComponenetName.Contains(bandName)) { luaGroup.luaComponenetName.Add(bandName); } } } Event.current.Use(); } }