public CallFunction ( string funcName ) : object[] | ||
funcName | string | |
return | object[] |
void OnInitialize() { mLuaManager.InitStart(); mLuaManager.DoFile("Logic/Game"); //加载游戏 mLuaManager.CallFunction("Game.OnInitOK"); //初始化完成 mKbeMain.initKBEngine(); initialize = true; }
public void ProgressChanged(object sender, DownloadProgressChangedEventArgs e) { AsyncTask.QueueOnMainThread ( () => { // NGUIDebug.Log(e.BytesReceived); // NGUIDebug.Log(e.TotalBytesToReceive); // NGUIDebug.Log(e.ProgressPercentage); luaM.CallFunction(this.luaName, this.callback_progress, new object[] { e.BytesReceived, e.TotalBytesToReceive, e.ProgressPercentage }); } ); }
public static void PayMoneyCallBack(string receipt_data, int result = 1) { LuaManager mgr = AppFacade.Instance.GetManager <LuaManager>(ManagerName.Lua); mgr.DoFile("CSToLuaFunction.lua"); if (result == 1) { mgr.CallFunction("PayMoneySuccess", receipt_data); } else { mgr.CallFunction("PayMoneyFailed", receipt_data); } }
void __joystickMove(EventContext context) { float degree = (float)context.data; //_text.text = "" + degree; LuaManager.CallFunction("GameCtrl.JoystickMove", degree); }
internal void Init() { if (m_initFlag == false) { m_initFlag = true; GameObject obj = new GameObject("PoolManager"); SpawnPool pool = obj.AddComponent <SpawnPool>(); pool.poolName = AppConst.PoolName; pool.dontDestroyOnLoad = true; PoolManager.Pools.Add(pool); GameObject lua = new GameObject("GameManager"); Main main = lua.AddComponent <Main>(); AppConst.GameManager = lua.transform; GameObject payObj = new GameObject("PaymentManager"); PaymentManager paymentManager = payObj.AddComponent <PaymentManager>(); } else { LuaManager mgr = AppFacade.Instance.GetManager <LuaManager>(ManagerName.Lua); mgr.DoFile("Main.lua"); mgr.CallFunction("EnterMainScene"); } }
public static void CallToLuaFunction(string functionName) { LuaManager mgr = AppFacade.Instance.GetManager <LuaManager>(ManagerName.Lua); mgr.DoFile("Main.lua"); mgr.CallFunction(functionName); }
public static void CallToLuaFunction(string funcName, params object[] args) { LuaManager mgr = AppFacade.Instance.GetManager <LuaManager>(ManagerName.Lua); mgr.DoFile("Main.lua"); mgr.CallFunction(funcName, args); }
public void Init() { luaManager.InitStart(); luaManager.DoFile("Game"); //加载游戏 luaManager.CallFunction("Game.OnInitOK"); //初始化完成 //isMe = false; //isMeFirst = false; //MainUI.Instance.onbutton = MatchMethod; //var text = MainUI.Instance.button.transform.Find("Text").GetComponent<Text>(); //text.text = "Match"; //uiText = text; }
/// <summary> /// 执行Lua方法 /// </summary> public static object[] CallMethod(string module, string func, params object[] args) { LuaManager luaMgr = LuaManager.Instance; if (luaMgr == null) { return(null); } return(luaMgr.CallFunction(module + "." + func, args)); }
/// <summary> /// 访问lua方法 /// </summary> /// <param name="module"></param> 文件名 /// <param name="func"></param> 方法名 /// <param name="args"></param> /// <returns></returns> public static object[] CallMethod(string module, string func, params object[] args) { LuaManager luaMgr = GameFacade.Instance.GetManager <LuaManager>(ManagersName.lua); if (luaMgr == null) { return(null); } return(luaMgr.CallFunction(TrimPath(module) + "." + func)); }
/// <summary> /// 执行Lua方法 /// </summary> public static object[] CallMethod(string module, string func, params object[] args) { LuaManager luaMgr = AppFacade.Instance.GetManager <LuaManager>(ManagerName.Lua); if (luaMgr == null) { return(null); } return(luaMgr.CallFunction(module + "." + func, args)); }
static int CallFunction(IntPtr L) { int count = LuaDLL.lua_gettop(L); LuaManager obj = LuaScriptMgr.GetNetObject <LuaManager>(L, 1); string arg0 = LuaScriptMgr.GetLuaString(L, 2); string arg1 = LuaScriptMgr.GetLuaString(L, 3); object[] objs2 = LuaScriptMgr.GetParamsObject(L, 4, count - 3); obj.CallFunction(arg0, arg1, objs2); return(0); }
static int CallFunction(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); LuaManager obj = (LuaManager)ToLua.CheckObject <LuaManager>(L, 1); string arg0 = ToLua.CheckString(L, 2); object[] arg1 = ToLua.ToParamsObject(L, 3, count - 2); object[] o = obj.CallFunction(arg0, arg1); ToLua.Push(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void DoSelect(LeanFinger finger, SceneSelectable selectable) { if (selectable == null) { LuaManager luaMgr = AppFacade.Instance.GetManager <LuaManager>(); if (luaMgr == null) { return; } luaMgr.CallFunction("ScreenTap", finger); } else { if (selectable.onTaped != null) { selectable.onTaped.Invoke(finger, selectable.gameObject); } } }
public void LoginCb(string token) { Debug.Log("token" + token); string className = System.IO.Path.GetFileNameWithoutExtension(luaPath); var luaTable = LuaManager.GetTable(className); if (luaTable == null) { LuaManager.DoFile(className); if (!string.IsNullOrEmpty(className)) { luaTable = LuaManager.GetTable(className); if (luaTable == null) { Util.LogError("Game", string.Format("没有找到{0}对应的lua表, 请确保文件名和lua表名一致", className)); } } } LuaManager.CallFunction("ConnectToLogin.ConnectToLoginServer", token); }
private static int CallFunction(IntPtr L) { int result; try { int num = LuaDLL.lua_gettop(L); LuaManager luaManager = (LuaManager)ToLua.CheckObject(L, 1, typeof(LuaManager)); string funcName = ToLua.CheckString(L, 2); object[] args = ToLua.ToParamsObject(L, 3, num - 2); object[] array = luaManager.CallFunction(funcName, args); ToLua.Push(L, array); result = 1; } catch (Exception e) { result = LuaDLL.toluaL_exception(L, e, null); } return(result); }
// Update is called once per frame void FixedUpdate() { LuaManager.CallFunction("GameCtrl.FixedUpdate"); }
private void OnCollisionEnter2D(Collision2D collision) { LuaManager.CallFunction("GameCtrl.OnCollisionEnter2D", collision); }
void __joystickEnd() { //_text.text = ""; LuaManager.CallFunction("GameCtrl.JoystickEnd"); }
public void UseAction(UnitAction _action, Tile _tile, Unit _owner) { LuaManager.CallFunction(luaScript, _action.actionName, _tile, _owner); }