private void TryActions(LuaAction[] actions, Transform actor) { if (actions == null) return; foreach (LuaAction action in actions) { if (action != null && action.condition != null && action.condition.IsTrue(actor)) DoAction(action, actor); } }
public void DoAction(LuaAction action, Transform actor) { if (action == null) { return; } Lua.Run(action.luaCode, debugLua); }
public static void recurse(LuaAction <Instance> func, Instance root) { foreach (var child in root.Children) { func.Invoke(child); recurse(func, child); } }
public void DoAction(LuaAction action, Transform actor) { if (action == null) { return; } Lua.Run(action.luaCode, debugLua); DialogueManager.SendUpdateTracker(); }
public OpCode(byte testFlag, byte setAFlag, EOpArgMask argBMode, EOpArgMask argCMode, EOpMode opMode, string name, LuaAction action) { TestFlag = testFlag; SetAFlag = setAFlag; ArgBMode = argBMode; ArgCMode = argCMode; OpMode = opMode; Name = name; Action = action; }
private LuaTable GetLuaTable() { LuaTable luaModule = ezLua.luaRequire(moduleName); LuaAwake awake = luaModule.Get <LuaAwake>("LuaAwake"); LuaTable table = awake == null ? luaModule : awake.Invoke(this); luaStart = table.Get <LuaAction <LuaTable> >("LuaStart"); luaOnEnable = table.Get <LuaAction <LuaTable> >("LuaOnEnable"); luaOnDisable = table.Get <LuaAction <LuaTable> >("LuaOnDisable"); luaOnDestroy = table.Get <LuaAction <LuaTable> >("LuaOnDestroy"); return(table); }
public void StartLua() { if (!string.IsNullOrEmpty(settings.luaBootModule)) { luaRequire(settings.luaBootModule); luaStart = luaEnv.Global.Get <LuaAction>(settings.luaEntrance); luaExit = luaEnv.Global.Get <LuaAction>(settings.luaExit); } if (luaStart != null) { luaStart(); } }
public override void Init() { base.Init(); luaEnv = new LuaEnv(); AddBuildin(); AddLoader(); luaEnv.DoString("require 'Main'"); luaStart = luaEnv.Global.Get <LuaAction>("Start"); luaExit = luaEnv.Global.Get <LuaAction>("Exit"); if (luaStart != null) { luaStart(); } }
void OnDestroy() { if (m_luaOnDestroy != null) { m_luaOnDestroy(); } m_client.Close(); m_client.OnEvent = null; m_client.OnMessage = null; m_client.OnRoomMessage = null; m_client = null; FastNet.App.finalize(); m_luaOnDestroy = null; m_luaUpdate = null; m_luaStart = null; m_mainScriptEnv.Dispose(); m_mainScriptEnv = null; }
/// <summary> /// Removes a function that was previously bound to the game closing. /// </summary> public void UnbindFromClose(LuaAction callback) { _closeBindings.TryRemove(callback); }
/// <summary> /// Binds a function to be called when the game is closing. /// </summary> /// <param name="callback">The callback function.</param> /// <param name="priority">The priority. Higher numbers are called first.</param> public void BindToClose(LuaAction callback, int priority = 0) { _closeBindings.TryAdd(callback, new OnCloseBinding(callback, priority)); }
public void DoAction(LuaAction action, Transform actor) { if (action == null) return; Lua.Run(action.luaCode, debugLua); }
void OnDestroy() { onUpdate = null; onLateUpdate = null; onFixedUpdate = null; }