Esempio n. 1
0
        public override void onEnter(params object[] parameters)
        {
            base.onEnter(parameters);
            GSUnityLuaShellWindow window = parameters[0] as GSUnityLuaShellWindow;

            window.SelectWindow.SetText(GSUnityLuaShellHistory.GetInstance().GetAllCommands());
        }
Esempio n. 2
0
        public static GSUnityLuaShellHistory GetInstance()
        {
            if (mInstance == null)
            {
                mInstance = new GSUnityLuaShellHistory();
            }

            return(mInstance);
        }
Esempio n. 3
0
        public void ParseResult()
        {
            Debug.LogError($"ParseResult text:{Text}");
            GSUnityLuaShellHistory.GetInstance().AddCommand(Text);
            treeView.AddChild($"{GSUnityLuaShellConst.CommandName}{Text}");
            object[] objects = Exec(Text);
            if (objects == null)
            {
            }
            else
            {
                if (objects.Length == 1)
                {
                    object result = objects[0];
                    if (result is LuaTable)
                    {
                        treeView.AddChild(result.ToString());
                        ParseResultLuaTable(result as LuaTable, 1);
                    }
                    else
                    {
                        treeView.AddChild(result == null ? "nil" : result.ToString());
                    }
                }
                else
                {
                    foreach (var obj in objects)
                    {
                        treeView.AddChild(obj == null ? "nil" : obj.ToString());
                    }
                }
            }

            treeView.Reload();
            treeView.SetSelection(new List <int>()
            {
                treeView.getRoot().children[treeView.getRoot().children.Count - 1].id
            }, TreeViewSelectionOptions.RevealAndFrame);
            Text = "";
        }