static int GetFlowChartTree(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); Nova.ScriptLoader obj = (Nova.ScriptLoader)ToLua.CheckObject <Nova.ScriptLoader>(L, 1); Nova.FlowChartTree o = obj.GetFlowChartTree(); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void Awake() { try { scriptLoader.Init(scriptPath); flowChartTree = scriptLoader.GetFlowChartTree(); } catch (Exception ex) { Debug.LogError(ex); Utils.Exit(); } checkpointManager = GetComponent <CheckpointManager>(); LuaRuntime.Instance.BindObject("variables", variables); LuaRuntime.Instance.BindObject("advancedDialogueHelper", advancedDialogueHelper); }
public void ForceInit(string path) { flowChartTree = new FlowChartTree(); currentNode = null; stateLocale = I18n.DefaultLocale; lazyBindingLinks = new List <LazyBindingEntry>(); // requires.lua is executed and ScriptDialogueEntryParser.PatternToActionGenerator is filled before calling ParseScript() LuaRuntime.Instance.BindObject("scriptLoader", this); foreach (var locale in I18n.SupportedLocales) { stateLocale = locale; string localizedPath = path; if (locale != I18n.DefaultLocale) { localizedPath = I18n.LocalePath + locale + "/" + path; } var scripts = Resources.LoadAll(localizedPath, typeof(TextAsset)).Cast <TextAsset>().ToArray(); foreach (var script in scripts) { ParseScript(script.text); } } // Bind all lazy binding entries BindAllLazyBindingEntries(); // Perform sanity check flowChartTree.SanityCheck(); // Construction finished, freeze the tree status flowChartTree.Freeze(); }
/// <summary> /// dirty force reload, simply reload all scripts, does not take too much in consideration. /// this method is only used for faster iteration during development, like preview changes in scripts without /// restart the game /// </summary> public void ReloadScripts() { scriptLoader.ForceInit(scriptPath); flowChartTree = scriptLoader.GetFlowChartTree(); UpdateGameState(true, true, false, false); }
private void Awake() { scriptLoader.Init(scriptPath); flowChartTree = scriptLoader.GetFlowChartTree(); }
/// <summary> /// Used for faster iterations during the development, like to modify scripts without restarting the game /// </summary> public void ReloadScripts() { LuaRuntime.Instance.Reset(); scriptLoader.ForceInit(scriptPath); flowChartTree = scriptLoader.GetFlowChartTree(); }
private void Awake() { scriptLoader.Init(scriptPath); flowChartTree = scriptLoader.GetFlowChartTree(); checkpointManager = GetComponent <CheckpointManager>(); }