Exemplo n.º 1
0
        private LuaTable GenUIView(UIContainer container)
        {
            if (container == null)
            {
                return(null);
            }
            LuaTable table = XLuaManager.GetLuaEnv().NewTable();

            table.Set <string, UIContainer>("container", container);
            table.Set <string, Transform>("transform", container.transform);
            for (int i = 0; i < container.names.Count; i++)
            {
                string    name      = container.names[i];
                Component component = container.behaviours[i];
                LuaTable  compTable;
                if (component is UIContainer)
                {
                    compTable = GenUIView(component as UIContainer);
                    table.Set(name, compTable);
                }
                else
                {
                    table.Set(name, component);
                }
            }

            return(table);
        }
Exemplo n.º 2
0
        public static LuaTable Load(string sceneName, Action loadCompleteCallback)
        {
            ResourceManager.Cleanup();

            TargetScene           = sceneName;
            LoadCompleteCallaback = loadCompleteCallback;
            IsLoading             = true;
            SceneManager.LoadSceneAsync(SceneNames.LoadingScene).completed += LoadEmptyComplete;

            if (m_Operation == null)
            {
                m_Operation = XLuaManager.GetLuaEnv().NewTable();
            }
            m_Operation.Set("IsDone", false);
            m_Operation.Set("process", 0);
            return(m_Operation);
        }