Example #1
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void Init()
        {
            panelPaths = new Dictionary <PanelId, string>();
            panelTypes = new Dictionary <PanelId, Type>();

            //初始化,找到所有的面板
            var typelist = Util.GetAllTypes(typeof(LuaFrameworkPanelAttribute));

            for (int i = 0; i < typelist.Count; i++)
            {
                Type panel_type = typelist[i];
                LuaFrameworkPanelAttribute att = (LuaFrameworkPanelAttribute)Attribute.GetCustomAttribute(panel_type, typeof(LuaFrameworkPanelAttribute));
                PanelId panel_id   = att.panelId;
                string  panel_path = att.resPath;

                panelPaths.Add(panel_id, panel_path);
                panelTypes.Add(panel_id, panel_type);
            }
        }