public static string GetTmpUpLoadPath(ConfigEnum configEnum) { string path = ""; switch (configEnum) { case ConfigEnum.Banner: path = TmpBannerYkseUpLoad; break; case ConfigEnum.HotNewsList: path = TmpHotNewListYkseUpLoad; break; case ConfigEnum.HotNewContent: path = TmpHotNewContentYkseUpLoad; break; case ConfigEnum.Newest: path = TmpNewestYkseUpLoad; break; default: break; } return(path); }
public T GetConfig <T>(ConfigEnum configType) { string configName = ConfigPrefabs[configType]; if (_ConfigPrefabs.ContainsKey(configName)) { return(_ConfigPrefabs[configName].GetComponent <T>()); } return(default(T)); }
IEnumerator Loading(ConfigEnum configEnum) { _loadingSlider.value = 0; _runPerson.GetComponent <RectTransform>().SetLocalPositionX(-450 + _loadingSlider.value * 900); while (_loadingSlider.value < 0.99f) { _loadingSlider.value += 0.01f; _runPerson.GetComponent <RectTransform>().SetLocalPositionX(-450 + _loadingSlider.value * 900); yield return(new WaitForSeconds(0.01f)); } UIManger.Instance._UIComponent.CloseUIForm(UIForm); UIManger.Instance._UIComponent.OpenUIForm(configEnum); }
public static MarketplaceWebServiceConfigBase CreateConfig(ConfigEnum configEnum) { MarketplaceWebServiceConfigBase config = null; switch (configEnum) { case ConfigEnum.Seller: { config = new MarketplaceWebServiceSellersConfig(); break; } } return(config); }
public ConfigHelper(ConfigEnum configEnum, string nodeID) { string filepath = string.Empty; switch (configEnum) { case ConfigEnum.Database: filepath = System.AppDomain.CurrentDomain.BaseDirectory + "Configuration\\db.config"; _config = new ConfigStrategyDB(filepath, "/root/dbs", "db", "value", nodeID); break; case ConfigEnum.StoredProcedure: filepath = System.AppDomain.CurrentDomain.BaseDirectory + "Configuration\\sp.config"; _config = new ConfigStrategySP(filepath, "/root", "sp", "value", nodeID); break; } }
//the enums list is just a list of strings with values ConfigEnum ReadEnums(long bodyOffset) { _input.Seek(bodyOffset, SeekOrigin.Begin); var entryCount = BinaryFile.ReadInt32(_input); if (entryCount == 0) { return(null); } var ret = new ConfigEnum(); for (var c = 0; c < entryCount; c++) { var name = BinaryFile.ReadString(_input); var val = BinaryFile.ReadInt32(_input); ret.Add(name, val); } return(ret); }
/// <summary> /// Gets or sets instance properties by ConfigParameter object /// </summary> /// <param name="configParam">Configuration parameter as specified by the ConfigEnum</param> /// <returns>Instance of Configuration parameter object to manage persistence</returns> public ConfigParameter this[ConfigEnum configParam] { get { return GetConfigParameter(configParam); } set { if (value.Value != null && value.Value.Length > 0) { PropertyInfo prop = thisType.GetProperty(Enum.GetName(typeof(ConfigEnum), configParam)); Type t = prop.PropertyType; Object o = Convert.ChangeType(value.Value, t); prop.SetValue(this, o, null); } } }
private void update(ConfigEnum e, string a) { configdatas[e.ToString()] = a; }
/// <summary> /// 文件目录不存在则创建,XML配置名称为: className +"窗体名称_"+gridView的名称.XML. /// </summary> /// <param name="ConfigModule">配置默认,用户级和项目级</param> /// <param name="className">类名,当画面是配置画面时,为了区分不同窗体而添加类名 </param> /// <param name="moduleName">一级模块名称(如DE,为空时取窗体名称的第4至6位)</param> public void SaveLayout(ConfigEnum ConfigModule, string moduleName, string className) { //模块名称 string formName = this.FindForm().Name; if (moduleName.Trim().Equals("")) { moduleName = formName.Length > 6 ? formName.Substring(4, 2) : formName; } if (formName.StartsWith("Form")) { formName = formName.Substring(4); } //XML路径 string fileDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location; fileDirectory = Path.GetDirectoryName(fileDirectory); if (ConfigModule == ConfigEnum.UserConfig) { //位于UserConfig下,用户名文件夹下,一级模块下 fileDirectory = fileDirectory + "\\..\\UserConfig\\" + "formUserId" + "\\" + moduleName + "\\"; } else if (ConfigModule == ConfigEnum.EPConfig) { //位于一级模块下 fileDirectory = fileDirectory + "\\..\\" + moduleName + "\\"; } else { //位于UserConfig下,用户名文件夹下,一级模块下 (默认用户配置) fileDirectory = fileDirectory + "\\..\\UserConfig\\" + "EF_Args.formUserId" + "\\" + moduleName + "\\"; } string fileDirectory2 = ""; try { fileDirectory2 = fileDirectory + "EC.UserConfig.Instance.Culture"+"\\"; } catch { } //文件目录不存在则创建[逻辑上,当是项目配置时,模块目录一定存在,否则报错] if (!System.IO.Directory.Exists(fileDirectory)) { System.IO.Directory.CreateDirectory(fileDirectory); } if (fileDirectory2 != "" && !System.IO.Directory.Exists(fileDirectory2)) { System.IO.Directory.CreateDirectory(fileDirectory2); } //为了应对多个View的情况,文件名以GridView为主 foreach (DevExpress.XtraGrid.Views.Base.BaseView view in this.Views) { //string fileName = className.Trim() + formName + "_" + view.Name + ".xml"; // ---2011-10-27 把 XML配置名称 改为 "窗体名称_"+View的名称+_className.XML string fileName = formName + "_" + view.Name + (className.Trim().Equals("") ? "" : ("_" + className.Trim())) + ".xml"; string filePath = fileDirectory + fileName; string filePath2 = fileDirectory2 + fileName; bool isFirstConfig = false; //if (System.IO.File.Exists(filePath)) //{ if (System.IO.File.Exists(filePath2)) { //文件已存在,则提示,是否覆盖 if (EF.EFMessageBox.Show("配置文件已存在,是否替换?", "提示", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } } //} else { isFirstConfig = true; } //添加默认保存 所有可保存项 if (view is DevExpress.XtraGrid.Views.Grid.GridView) { (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.StoreAllOptions = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.StoreAppearance = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.StoreDataSettings = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.StoreVisualOptions = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.Columns.StoreAllOptions = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.Columns.StoreAppearance = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.Columns.StoreLayout = true; } if (isFirstConfig) { //即使是第一次配置也不保存到默认目录下.只放到对应语言目录下 //view.SaveLayoutToXml(filePath); } view.SaveLayoutToXml(filePath2); } }
/// <summary> /// 以窗体Form的名称+"_"+gridView的名称,以及制定的配置模式保存grid配置 /// </summary> /// <param name="ConfigModule">用户级和项目级</param> public void SaveLayout(ConfigEnum ConfigModule) { this.SaveLayout(ConfigModule, string.Empty, string.Empty); }
/// <summary> /// 加载已保存的布局。 /// 寻找(窗体Form的名称+"_"+gridView的名称+ className)的配置文件.加载布局..根据参数(配置模式)选择对应目录下的配置文件. /// </summary> /// <param name="ConfigModule">配置模式,默认时先查找用户配置,再查找项目级配置..</param> /// <param name="moduleName">一级模块名称.如DE,FI等</param> /// <param name="className">类名称[当窗体名称_+gridView名称不能满足唯一xml文件名需求时,在开头添加类名称</param> public void LoadLayout(ConfigEnum configModule, string moduleName, string className) { //模块名称 string formName = this.FindForm().Name; if (moduleName.Trim().Equals("")) { moduleName = formName.Length > 6 ? formName.Substring(4, 2) : formName; } if (formName.StartsWith("Form")) { formName = formName.Substring(4); } //XML路径 string fileDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location; fileDirectory = Path.GetDirectoryName(fileDirectory); string fileDirectoryUser = fileDirectory + "\\..\\UserConfig\\" + "EF_Args.formUserId" + "\\" + moduleName + "\\"; string fileDirectoryEP = fileDirectory + "\\..\\" + moduleName + "\\"; //先查看用户级配置,目录不存在读取项目配置 foreach (DevExpress.XtraGrid.Views.Base.BaseView view in this.Views) { //添加默认加载所有保存项 if (view is DevExpress.XtraGrid.Views.Grid.GridView) { (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.StoreAllOptions = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.StoreAppearance = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.StoreDataSettings = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.StoreVisualOptions = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.Columns.StoreAllOptions = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.Columns.StoreAppearance = true; (view as DevExpress.XtraGrid.Views.Grid.GridView).OptionsLayout.Columns.StoreLayout = true; } // ---2011-10-27 把 XML配置名称 改为 "窗体名称_"+View的名称+_className.XML string fileName = formName + "_" + view.Name + (className.Trim().Equals("") ? "" : ("_" + className.Trim())) + ".xml"; // string fileName = className.Trim() + formName + "_" + view.Name + ".xml"; string filePath = ""; //配置文件位置 if (configModule == ConfigEnum.EPConfig) { filePath = fileDirectoryEP + fileName; } else if (configModule == ConfigEnum.UserConfig) { filePath = fileDirectoryUser + fileName; } else //默认配置.先读取用户级配置,不存在则读取项目级配置 { filePath = fileDirectoryUser + fileName; string tmp2 = filePath; if (!System.IO.File.Exists(filePath)&& !IsFileExit(ref tmp2)) //用户配置不存在,则读取项目级配置 { filePath = fileDirectoryEP + fileName; } } //根据配置模式,找到xml文件.存在,则读取 if (IsFileExit(ref filePath))// (System.IO.File.Exists(filePath)) { string EPConfigXML = fileDirectoryEP + fileName; //项目级配置xml //项目级配置xml 如果存在就麻烦了---不存在,则直接读取配置文件 //---先加载项目级配置,把不可见的项,设置为不可配置 //---如果是用户配置则 "再加载用户级配置",否则退出 //---再把不可配置项设为不可见 if (IsFileExit(ref EPConfigXML)) { view.RestoreLayoutFromXml(EPConfigXML); if (view is DevExpress.XtraGrid.Views.Grid.GridView) { foreach (DevExpress.XtraGrid.Columns.GridColumn gridCol in ((DevExpress.XtraGrid.Views.Grid.GridView)view).Columns) { gridCol.OptionsColumn.ShowInCustomizationForm = gridCol.Visible; } } //然后加载用户级配置 if (filePath.Equals(EPConfigXML)) { break; } view.RestoreLayoutFromXml(filePath); //然后再次检查,把项目级不可见的,也设为不可见 if (view is DevExpress.XtraGrid.Views.Grid.GridView) { foreach (DevExpress.XtraGrid.Columns.GridColumn gridCol in ((DevExpress.XtraGrid.Views.Grid.GridView)view).Columns) { //如果本来是不可配置的,设为不可见..否则不用管 if (!gridCol.OptionsColumn.ShowInCustomizationForm) { gridCol.Visible = false; } //gridCol.Visible = gridCol.OptionsColumn.ShowInCustomizationForm; // } } // return true; } else { view.RestoreLayoutFromXml(filePath); } } else { //return false; } } // return true; }
/// <summary> /// 加载已保存的布局。 /// 寻找(以窗体Form的名称+"_"+gridView的名称)的配置文件.加载布局..根据参数(配置模式)选择对应目录下的配置文件. /// </summary> /// <param name="ConfigModule">配置模式:用户级UserConfig ,项目级EPConfig </param> public void LoadLayout(ConfigEnum configModule) { LoadLayout(configModule, "", ""); }
/******************************8 /// <summary> /// �Դ���Form������+"_"+EFDevLayoutControl������,�Լ�Ĭ������ģʽ[�ݶ��û���]����grid���� /// </summary> public void SaveLayout(DevExpress.XtraLayout.LayoutControl layoutControl) { SaveLayout(layoutControl, ConfigEnum.Default); } /// <summary> /// �Դ���Form������+"_"+gridView������,�Լ��ƶ�������ģʽ����grid���� /// </summary> /// <param name="ConfigModule">�û�������Ŀ��</param> public void SaveLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule) { this.SaveLayout(layoutControl, ConfigModule, string.Empty, string.Empty); } ******************************/ /// <summary> /// �ļ�Ŀ¼��������,XML��������Ϊ: className +"��������_"+EFDevLayoutControl������.XML. /// ---2011-10-27 �� XML�������� ��Ϊ "��������_"+EFDevLayoutControl������+_className.XML /// </summary> /// <param name="ConfigModule">����Ĭ��,�û�������Ŀ��</param> /// <param name="className">����,�����������û���ʱ,Ϊ�����ֲ�ͬ������������ </param> /// <param name="moduleName">һ��ģ������(��DE,Ϊ��ʱȡ�������Ƶĵ�4��6λ)</param> public void SaveLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule, string className, string moduleName) { //ģ������ string formName = layoutControl.FindForm().Name; if (moduleName.Trim().Equals("")) { moduleName = formName.Length > 6 ? formName.Substring(4, 2) : formName; } if (formName.StartsWith("Form")) { formName = formName.Substring(4); } //XML·�� string fileDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location; fileDirectory = Path.GetDirectoryName(fileDirectory); if (ConfigModule == ConfigEnum.UserConfig) { //λ��UserConfig��,�û����ļ�����,һ��ģ���� fileDirectory = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\"; } else if (ConfigModule == ConfigEnum.EPConfig) { //λ��һ��ģ���� fileDirectory = fileDirectory + "\\..\\" + moduleName + "\\"; } else { //λ��UserConfig��,�û����ļ�����,һ��ģ���� (Ĭ���û�����) fileDirectory = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\"; } string fileDirectory2 = ""; try { fileDirectory2 = fileDirectory + "EC.UserConfig.Instance.Culture" + "\\"; } catch { } //�ļ�Ŀ¼��������[����,������Ŀ����ʱ,ģ��Ŀ¼һ������,����] if (!System.IO.Directory.Exists(fileDirectory)) { System.IO.Directory.CreateDirectory(fileDirectory); } if (fileDirectory2 != "" && !System.IO.Directory.Exists(fileDirectory2)) { System.IO.Directory.CreateDirectory(fileDirectory2); } //�����ļ��� //string fileName = className.Trim() + formName + "_" + layoutControl.Name + ".xml"; // ---2011-10-27 �� XML�������� ��Ϊ "��������_"+EFDevLayoutControl������+_className.XML string fileName = formName + "_" + layoutControl.Name +(className.Trim().Equals("")?"":("_"+className.Trim()))+ ".xml"; string filePath = fileDirectory + fileName; string filePath2 = fileDirectory2 + fileName; bool isFirstConfig = false; if (System.IO.File.Exists(filePath)) { if (System.IO.File.Exists(filePath2)) { //�ļ��Ѵ���,����ʾ,�Ƿ� if (EF.EFMessageBox.Show("�����ļ��Ѵ���,�Ƿ��滻��","��ʾ", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } } } else { isFirstConfig = false; } if (isFirstConfig) { //��ʹ�ǵ�һ������Ҳ�����浽Ĭ��Ŀ¼��.ֻ�ŵ���Ӧ����Ŀ¼�� // layoutControl.SaveLayoutToXml(filePath); } layoutControl.SaveLayoutToXml(filePath2); }
public int OpenUIForm(ConfigEnum configEnum, object userData) { FormConfig fc = ConfigManger.Instance.GetConfig <FormConfig>((int)configEnum); return(OpenUIForm(fc.ScenePosition + fc.SceneName, fc.SceneGroup, userData)); }
private static void readConfiguration(bool readConfig) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("Assets/LayaAir3D/LayaTool/Configuration.xml"); XmlNode xn = xmlDoc.SelectSingleNode("LayaExportSetting"); XmlNodeList xnList = xn.ChildNodes; if (readConfig) { switch (int.Parse(xnList[0].InnerText)) { case 1: configEnum = ConfigEnum.config1; break; case 2: configEnum = ConfigEnum.config2; break; case 3: configEnum = ConfigEnum.config3; break; case 4: configEnum = ConfigEnum.config4; break; case 5: configEnum = ConfigEnum.config5; break; default: break; } lastConfigIndex = curConfigIndex = int.Parse(xnList[0].InnerText); } FirstlevelMenu = int.Parse(xnList[curConfigIndex].SelectSingleNode("FirstlevelMenu").InnerText); MeshSetting = bool.Parse(xnList[curConfigIndex].SelectSingleNode("MeshSetting").InnerText); IgnoreVerticesUV = bool.Parse(xnList[curConfigIndex].SelectSingleNode("IgnoreVerticesUV").InnerText); IgnoreVerticesNormal = bool.Parse(xnList[curConfigIndex].SelectSingleNode("IgnoreVerticesNormal").InnerText); IgnoreVerticesTangent = bool.Parse(xnList[curConfigIndex].SelectSingleNode("IgnoreVerticesTangent").InnerText); IgnoreVerticesColor = bool.Parse(xnList[curConfigIndex].SelectSingleNode("IgnoreVerticesColor").InnerText); TextureSetting = bool.Parse(xnList[curConfigIndex].SelectSingleNode("TextureSetting").InnerText); ConvertTexture = bool.Parse(xnList[curConfigIndex].SelectSingleNode("ConvertTexture").InnerText); ConvertNonPNGAndJPG = bool.Parse(xnList[curConfigIndex].SelectSingleNode("ConvertNonPNGAndJPG").InnerText); ConvertOriginPNG = bool.Parse(xnList[curConfigIndex].SelectSingleNode("ConvertOriginPNG").InnerText); ConvertOriginJPG = bool.Parse(xnList[curConfigIndex].SelectSingleNode("ConvertOriginJPG").InnerText); targetTextureTypeEnum = int.Parse(xnList[curConfigIndex].SelectSingleNode("ConvertToType").InnerText) == 0 ? TargetTextureTypeEnum.jpg : TargetTextureTypeEnum.png; ConvertQuality = float.Parse(xnList[curConfigIndex].SelectSingleNode("ConvertQuality").InnerText); TerrainSetting = bool.Parse(xnList[curConfigIndex].SelectSingleNode("TerrainSetting").InnerText); ConvertTerrain = bool.Parse(xnList[curConfigIndex].SelectSingleNode("ConvertTerrain").InnerText); switch (int.Parse(xnList[curConfigIndex].SelectSingleNode("TerrainToMeshResolution").InnerText)) { case 2: terrainToMeshResolution = TerrainToMeshResolution.VeryHeight; break; case 4: terrainToMeshResolution = TerrainToMeshResolution.Height; break; case 8: terrainToMeshResolution = TerrainToMeshResolution.Medium; break; case 16: terrainToMeshResolution = TerrainToMeshResolution.Low; break; case 32: terrainToMeshResolution = TerrainToMeshResolution.VeryLow; break; default: terrainToMeshResolution = TerrainToMeshResolution.Medium; break; } GameObjectSetting = bool.Parse(xnList[curConfigIndex].SelectSingleNode("GameObjectSetting").InnerText); IgnoreNotActiveGameObject = bool.Parse(xnList[curConfigIndex].SelectSingleNode("IgnoreNotActiveGameObject").InnerText); BatchMade = bool.Parse(xnList[curConfigIndex].SelectSingleNode("BatchMade").InnerText); OtherSetting = bool.Parse(xnList[curConfigIndex].SelectSingleNode("OtherSetting").InnerText); // CoverOriginalFile = bool.Parse(xnList[curConfigIndex].SelectSingleNode("CoverOriginalFile").InnerText); CustomizeDirectory = bool.Parse(xnList[curConfigIndex].SelectSingleNode("CustomizeDirectory").InnerText); CustomizeDirectoryName = xnList[curConfigIndex].SelectSingleNode("CustomizeDirectoryName").InnerText; AutoSave = bool.Parse(xnList[curConfigIndex].SelectSingleNode("AutoSave").InnerText); Ios = bool.Parse(xnList[curConfigIndex].SelectSingleNode("Ios").InnerText); Android = bool.Parse(xnList[curConfigIndex].SelectSingleNode("Android").InnerText); Conventional = bool.Parse(xnList[curConfigIndex].SelectSingleNode("Conventional").InnerText); SAVEPATH = xnList[curConfigIndex].SelectSingleNode("SavePath").InnerText; ScrollPosition.y = float.Parse(xnList[curConfigIndex].SelectSingleNode("ScrollPositionY").InnerText); }
/// <summary> /// Ѱ��(�Դ���Form������+"_"+EFDevLayoutControl������)�������ļ�.���ز���..���ݲ���(����ģʽ)ѡ���ӦĿ¼�µ������ļ�. /// </summary> /// <param name="ConfigModule"></param> public void LoadLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule) { LoadLayout(layoutControl, this.configType, className, moduleName); }
/// <summary> /// 寻找(以窗体Form的名称+"_"+EFDevLayoutControl的名称)的配置文件.加载布局..根据参数(配置模式)选择对应目录下的配置文件. /// </summary> /// <param name="ConfigModule"></param> public void LoadLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule) { LoadLayout(layoutControl, this.configType, className, moduleName); }
/******************************8 * /// <summary> * /// 以窗体Form的名称+"_"+EFDevLayoutControl的名称,以及默认配置模式[暂定用户级]保存grid配置 * /// </summary> * public void SaveLayout(DevExpress.XtraLayout.LayoutControl layoutControl) * { * SaveLayout(layoutControl, ConfigEnum.Default); * } * /// <summary> * /// 以窗体Form的名称+"_"+gridView的名称,以及制定的配置模式保存grid配置 * /// </summary> * /// <param name="ConfigModule">用户级和项目级</param> * public void SaveLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule) * { * this.SaveLayout(layoutControl, ConfigModule, string.Empty, string.Empty); * } ******************************/ /// <summary> /// 文件目录不存在则创建,XML配置名称为: className +"窗体名称_"+EFDevLayoutControl的名称.XML. /// ---2011-10-27 把 XML配置名称 改为 "窗体名称_"+EFDevLayoutControl的名称+_className.XML /// </summary> /// <param name="ConfigModule">配置默认,用户级和项目级</param> /// <param name="className">类名,当画面是配置画面时,为了区分不同窗体而添加类名 </param> /// <param name="moduleName">一级模块名称(如DE,为空时取窗体名称的第4至6位)</param> public void SaveLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule, string className, string moduleName) { //模块名称 string formName = layoutControl.FindForm().Name; if (moduleName.Trim().Equals("")) { moduleName = formName.Length > 6 ? formName.Substring(4, 2) : formName; } if (formName.StartsWith("Form")) { formName = formName.Substring(4); } //XML路径 string fileDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location; fileDirectory = Path.GetDirectoryName(fileDirectory); if (ConfigModule == ConfigEnum.UserConfig) { //位于UserConfig下,用户名文件夹下,一级模块下 fileDirectory = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\"; } else if (ConfigModule == ConfigEnum.EPConfig) { //位于一级模块下 fileDirectory = fileDirectory + "\\..\\" + moduleName + "\\"; } else { //位于UserConfig下,用户名文件夹下,一级模块下 (默认用户配置) fileDirectory = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\"; } string fileDirectory2 = ""; try { fileDirectory2 = fileDirectory + "EC.UserConfig.Instance.Culture" + "\\"; } catch { } //文件目录不存在则创建[逻辑上,当是项目配置时,模块目录一定存在,否则报错] if (!System.IO.Directory.Exists(fileDirectory)) { System.IO.Directory.CreateDirectory(fileDirectory); } if (fileDirectory2 != "" && !System.IO.Directory.Exists(fileDirectory2)) { System.IO.Directory.CreateDirectory(fileDirectory2); } //保存文件名 //string fileName = className.Trim() + formName + "_" + layoutControl.Name + ".xml"; // ---2011-10-27 把 XML配置名称 改为 "窗体名称_"+EFDevLayoutControl的名称+_className.XML string fileName = formName + "_" + layoutControl.Name + (className.Trim().Equals("")?"":("_" + className.Trim())) + ".xml"; string filePath = fileDirectory + fileName; string filePath2 = fileDirectory2 + fileName; bool isFirstConfig = false; if (System.IO.File.Exists(filePath)) { if (System.IO.File.Exists(filePath2)) { //文件已存在,则提示,是否覆盖 if (EF.EFMessageBox.Show("配置文件已存在,是否替换?", "提示", MessageBoxButtons.YesNo) != DialogResult.Yes) { return; } } } else { isFirstConfig = false; } if (isFirstConfig) { //即使是第一次配置也不保存到默认目录下.只放到对应语言目录下 // layoutControl.SaveLayoutToXml(filePath); } layoutControl.SaveLayoutToXml(filePath2); }
void OnGUI() { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(10)); FirstlevelMenu = GUILayout.Toolbar(FirstlevelMenu, new string[] { "Scene", "Sprite3D" }, GUILayout.Height(30)); configEnum = (ConfigEnum)EditorGUILayout.EnumPopup("", configEnum, GUILayout.Width(60)); GUILayout.EndHorizontal(); ScrollPosition = GUILayout.BeginScrollView(ScrollPosition); GUILayout.Box("", GUILayout.Height(3), GUILayout.ExpandWidth(true)); //---------------------------------------MeshSetting------------------------------------------ MeshSetting = GUILayout.Toggle(MeshSetting, " Mesh Setting"); if (MeshSetting) { GUILayout.BeginVertical(GUILayout.ExpandWidth(true)); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); IgnoreVerticesTangent = GUILayout.Toggle(IgnoreVerticesTangent, " Ignore Vertices Tangent"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); IgnoreVerticesColor = GUILayout.Toggle(IgnoreVerticesColor, " Ignore Vertices Color"); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } //---------------------------------------MeshSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); //---------------------------------------TextureSetting------------------------------------------ TextureSetting = GUILayout.Toggle(TextureSetting, " Texture Setting"); if (TextureSetting) { if (TextureSetting) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(10)); GUILayout.Label(" Original Texture Type"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(30)); ConvertNonPNGAndJPG = GUILayout.Toggle(ConvertNonPNGAndJPG, " Non-PNG|JPG"); ConvertOriginPNG = GUILayout.Toggle(ConvertOriginPNG, " PNG"); ConvertOriginJPG = GUILayout.Toggle(ConvertOriginJPG, " JPG"); if (FirstlevelMenu == 0) { ConvertLightMap = GUILayout.Toggle(ConvertLightMap, " LightMap"); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(10)); GUILayout.Label(" Target Texture Type"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(30)); targetTextureTypeEnum = (TargetTextureTypeEnum)EditorGUILayout.EnumPopup("", targetTextureTypeEnum, GUILayout.MaxWidth(60)); if (targetTextureTypeEnum == TargetTextureTypeEnum.jpg) { //ConvertToPNG = false; GUILayout.Label("CompressQuality", GUILayout.Width(101)); ConvertQuality = EditorGUILayout.Slider(ConvertQuality, 0.0f, ConvertMaxQuality, GUILayout.MinWidth(100)); } GUILayout.EndHorizontal(); } } //---------------------------------------TextureSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); //---------------------------------------AnimationSetting------------------------------------------ AniSetting = GUILayout.Toggle(AniSetting, " Animation Setting"); if (AniSetting) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); SimplifyBone = GUILayout.Toggle(SimplifyBone, " Optimize Bones"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); GUILayout.Label("CompressLsani"); LsaniCompressValue = EditorGUILayout.Slider(LsaniCompressValue, 0.0f, LsaniCompressMaxValue); GUILayout.EndHorizontal(); } //---------------------------------------AnimationSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); //---------------------------------------TerrainSetting------------------------------------------ TerrainSetting = GUILayout.Toggle(TerrainSetting, " Terrain Setting"); if (TerrainSetting) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); ConvertTerrain = GUILayout.Toggle(ConvertTerrain, " Convert Terrain To Mesh"); GUILayout.EndHorizontal(); if (ConvertTerrain) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(30)); terrainToMeshResolution = (TerrainToMeshResolution)EditorGUILayout.EnumPopup(" Resolution", terrainToMeshResolution); GUILayout.EndHorizontal(); } } //---------------------------------------TerrainSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); //---------------------------------------GameObjectSetting------------------------------------------ GameObjectSetting = GUILayout.Toggle(GameObjectSetting, " GameObject Setting"); if (GameObjectSetting) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); GUILayout.BeginVertical(GUILayout.ExpandWidth(true)); IgnoreNullGameObject = GUILayout.Toggle(IgnoreNullGameObject, " Ignore Null Game Objects"); IgnoreNotActiveGameObject = GUILayout.Toggle(IgnoreNotActiveGameObject, " Ignore Not Active Game Objects"); OptimizeGameObject = GUILayout.Toggle(OptimizeGameObject, " Optimize Game Objects"); if (FirstlevelMenu == 1) { BatchMade = GUILayout.Toggle(BatchMade, " Batch Make The First Level Game Objects"); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); } //---------------------------------------GameObjectSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); //---------------------------------------OtherSetting------------------------------------------ OtherSetting = GUILayout.Toggle(OtherSetting, " Other Setting"); if (OtherSetting) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); GUILayout.BeginVertical(GUILayout.ExpandWidth(true)); CoverOriginalFile = GUILayout.Toggle(CoverOriginalFile, " Cover Original Export Files"); GUILayout.BeginHorizontal(); CustomizeDirectory = GUILayout.Toggle(CustomizeDirectory, " Customize Export Root Directory Name", GUILayout.Width(250)); if (CustomizeDirectory) { CustomizeDirectoryName = GUILayout.TextField(CustomizeDirectoryName); } GUILayout.EndHorizontal(); AutoSave = GUILayout.Toggle(AutoSave, " Automatically Save The Configuration"); GUILayout.EndVertical(); GUILayout.EndHorizontal(); } //---------------------------------------OtherSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); GUILayout.Label("Save Path", GUILayout.Width(65)); SAVEPATH = GUILayout.TextField(SAVEPATH, GUILayout.Height(21)); if (GUILayout.Button("Browse", GUILayout.MaxWidth(100), GUILayout.Height(22))) { SAVEPATH = EditorUtility.SaveFolderPanel("LayaUnityPlugin", "Assets", ""); } GUILayout.EndHorizontal(); GUILayout.Box("", GUILayout.Height(3), GUILayout.ExpandWidth(true)); GUILayout.BeginHorizontal(); GUILayout.Space(2f); if (GUILayout.Button("Clear Config", GUILayout.Height(22))) { clearConfiguration(); } if (GUILayout.Button("Revert Config", GUILayout.Height(22))) { readConfiguration(false); } if (GUILayout.Button("Save Config", GUILayout.Height(22))) { saveConfiguration(); } GUILayout.EndHorizontal(); GUILayout.Space(2f); GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); GUILayout.Space(2f); GUILayout.BeginHorizontal(); if (GUILayout.Button("LayaAir Run", GUILayout.Height(26))) { exportResource(true); runLayaDemo(); } if (GUILayout.Button("LayaAir Export", GUILayout.Height(26))) { exportResource(false); } if (GUILayout.Button("Help?", GUILayout.Width(45), GUILayout.Height(26))) { Application.OpenURL("https://ask.layabox.com/question/4242"); } GUILayout.EndHorizontal(); GUILayout.Space(10f); }
private ConfigParameter GetConfigParameter(ConfigEnum name) { int paramId = (int)name; String propName = Enum.GetName(typeof(ConfigEnum), name); var valueObject=thisType.GetProperty(propName).GetValue(this, null); String value = String.Empty; if (valueObject != null) value = valueObject.ToString(); return new ConfigParameter(name, value); }
/// <summary> /// Setter for the read-only property name. Property is made read-only to constrain the parameter names that can be specified. /// </summary> /// <param name="name"></param> public void SetName(ConfigEnum name) { this.Name = Enum.GetName(typeof(ConfigEnum), name); }
/// <summary> /// 寻找(以className+窗体Form的名称+"_"+EFDevLayoutControl的名称)的配置文件.加载布局..根据参数(配置模式)选择对应目录下的配置文件. /// </summary> /// <param name="ConfigModule">配置模式,默认时先查找用户配置,再查找项目级配置..</param> /// <param name="className">类名称[当窗体名称_+EFDevLayoutControl名称不能满足唯一xml文件名需求时,在开头添加类名称</param> /// <param name="moduleName">一级模块名称.如DE,FI等</param> public void LoadLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule, string className, string moduleName) { //模块名称 string formName = layoutControl.FindForm().Name; if (moduleName.Trim().Equals("")) { moduleName = formName.Length > 6 ? formName.Substring(4, 2) : formName; } if (formName.StartsWith("Form")) { formName = formName.Substring(4); } //XML路径 string fileDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location; fileDirectory = Path.GetDirectoryName(fileDirectory); string fileDirectoryUser = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\"; string fileDirectoryEP = fileDirectory + "\\..\\" + moduleName + "\\"; //先查看用户级配置,目录不存在读取项目配置 // ---2011-10-27 把 XML配置名称 改为 "窗体名称_"+EFDevLayoutControl的名称+_className.XML string fileName = formName + "_" + layoutControl.Name + (className.Trim().Equals("") ? "" : ("_" + className.Trim())) + ".xml"; //string fileName = className.Trim() + formName + "_" + layoutControl.Name + ".xml"; string filePath = ""; if (ConfigModule == ConfigEnum.EPConfig) { filePath = fileDirectoryEP + fileName; } else if (ConfigModule == ConfigEnum.UserConfig) { filePath = fileDirectoryUser + fileName; } else //默认配置.先读取用户级配置,不存在则读取项目级配置 { filePath = fileDirectoryUser + fileName; if (!IsFileExit(ref filePath)) //不存在,则读取项目级的 { filePath = fileDirectoryEP + fileName; } } if (IsFileExit(ref filePath)) // (System.IO.File.Exists(filePath)) //存在,则读取 { //string EPConfigXML = fileDirectoryEP + fileName; //项目级配置xml //项目级配置xml 如果存在就麻烦了---不存在,则直接读取配置文件 //---先加载项目级配置,把不可见的项,设置为不可配置 //---如果是用户配置则 "再加载用户级配置",否则退出 //---再把不可配置项设为不可见 //if (System.IO.File.Exists(EPConfigXML)) //{ // layoutControl.RestoreLayoutFromXml(EPConfigXML); // if (view is DevExpress.XtraGrid.Views.Grid.GridView) // { // foreach (DevExpress.XtraGrid.Columns.GridColumn gridCol in ((DevExpress.XtraGrid.Views.Grid.GridView)view).Columns) // { // gridCol.OptionsColumn.ShowInCustomizationForm = gridCol.Visible; // } // } // //然后加载用户级配置 // if (filePath.Equals(EPConfigXML)) // { // break; // } // view.RestoreLayoutFromXml(filePath); // //然后再次检查,把项目级不可见的,也设为不可见 // if (view is DevExpress.XtraGrid.Views.Grid.GridView) // { // foreach (DevExpress.XtraGrid.Columns.GridColumn gridCol in ((DevExpress.XtraGrid.Views.Grid.GridView)view).Columns) // { // gridCol.Visible = gridCol.OptionsColumn.ShowInCustomizationForm; // } // } //} //else //{ // view.RestoreLayoutFromXml(filePath); //} layoutControl.RestoreLayoutFromXml(filePath); // return true; } else { // return false; } }
/// <summary> /// Ѱ��(��className+����Form������+"_"+EFDevLayoutControl������)�������ļ�.���ز���..���ݲ���(����ģʽ)ѡ���ӦĿ¼�µ������ļ�. /// </summary> /// <param name="ConfigModule">����ģʽ,Ĭ��ʱ�Ȳ����û�����,�ٲ�����Ŀ������..</param> /// <param name="className">������[����������_+EFDevLayoutControl���Ʋ�������Ψһxml�ļ�������ʱ,�ڿ�ͷ���������</param> /// <param name="moduleName">һ��ģ������.��DE,FI��</param> public void LoadLayout(DevExpress.XtraLayout.LayoutControl layoutControl, ConfigEnum ConfigModule, string className, string moduleName) { //ģ������ string formName = layoutControl.FindForm().Name; if (moduleName.Trim().Equals("")) { moduleName = formName.Length > 6 ? formName.Substring(4, 2) : formName; } if (formName.StartsWith("Form")) { formName = formName.Substring(4); } //XML·�� string fileDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location; fileDirectory = Path.GetDirectoryName(fileDirectory); string fileDirectoryUser = fileDirectory + "\\..\\UserConfig\\" + "EF.EF_Args.formUserId" + "\\" + moduleName + "\\"; string fileDirectoryEP = fileDirectory + "\\..\\" + moduleName + "\\"; //�Ȳ鿴�û�������,Ŀ¼�����ڶ�ȡ��Ŀ���� // ---2011-10-27 �� XML�������� ��Ϊ "��������_"+EFDevLayoutControl������+_className.XML string fileName = formName + "_" + layoutControl.Name + (className.Trim().Equals("") ? "" : ("_" + className.Trim())) + ".xml"; //string fileName = className.Trim() + formName + "_" + layoutControl.Name + ".xml"; string filePath = ""; if (ConfigModule == ConfigEnum.EPConfig) { filePath = fileDirectoryEP + fileName; } else if (ConfigModule == ConfigEnum.UserConfig) { filePath = fileDirectoryUser + fileName; } else //Ĭ������.�ȶ�ȡ�û�������,���������ȡ��Ŀ������ { filePath = fileDirectoryUser + fileName; if (! IsFileExit(ref filePath))//������,���ȡ��Ŀ���� { filePath = fileDirectoryEP + fileName; } } if (IsFileExit(ref filePath)) // (System.IO.File.Exists(filePath)) //����,���ȡ { //string EPConfigXML = fileDirectoryEP + fileName; //��Ŀ������xml //��Ŀ������xml ������ھ��鷳��---������,��ֱ�Ӷ�ȡ�����ļ� //---�ȼ�����Ŀ������,�Ѳ��ɼ�����,����Ϊ�������� //---������û������� "�ټ����û�������",�����˳� //---�ٰѲ�����������Ϊ���ɼ� //if (System.IO.File.Exists(EPConfigXML)) //{ // layoutControl.RestoreLayoutFromXml(EPConfigXML); // if (view is DevExpress.XtraGrid.Views.Grid.GridView) // { // foreach (DevExpress.XtraGrid.Columns.GridColumn gridCol in ((DevExpress.XtraGrid.Views.Grid.GridView)view).Columns) // { // gridCol.OptionsColumn.ShowInCustomizationForm = gridCol.Visible; // } // } // //Ȼ������û������� // if (filePath.Equals(EPConfigXML)) // { // break; // } // view.RestoreLayoutFromXml(filePath); // //Ȼ���ٴμ��,����Ŀ�����ɼ���,Ҳ��Ϊ���ɼ� // if (view is DevExpress.XtraGrid.Views.Grid.GridView) // { // foreach (DevExpress.XtraGrid.Columns.GridColumn gridCol in ((DevExpress.XtraGrid.Views.Grid.GridView)view).Columns) // { // gridCol.Visible = gridCol.OptionsColumn.ShowInCustomizationForm; // } // } //} //else //{ // view.RestoreLayoutFromXml(filePath); //} layoutControl.RestoreLayoutFromXml(filePath); // return true; } else { // return false; } }
void OnGUI() { //是否完成了纹理压缩 EditorGUI.BeginDisabledGroup(HTTPClient.LoadingTexture != 0); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(10)); FirstlevelMenu = GUILayout.Toolbar(FirstlevelMenu, new string[] { "Scene", "Sprite3D" }, GUILayout.Height(30)); configEnum = (ConfigEnum)EditorGUILayout.EnumPopup("", configEnum, GUILayout.Width(60)); GUILayout.EndHorizontal(); ScrollPosition = GUILayout.BeginScrollView(ScrollPosition); GUILayout.Box("", GUILayout.Height(3), GUILayout.ExpandWidth(true)); //---------------------------------------MeshSetting------------------------------------------ MeshSetting = GUILayout.Toggle(MeshSetting, " Mesh Setting"); if (MeshSetting) { GUILayout.BeginVertical(GUILayout.ExpandWidth(true)); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); IgnoreVerticesUV = GUILayout.Toggle(IgnoreVerticesUV, " Ignore Vertices UV"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); IgnoreVerticesColor = GUILayout.Toggle(IgnoreVerticesColor, " Ignore Vertices Color"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); IgnoreVerticesNormal = GUILayout.Toggle(IgnoreVerticesNormal, " Ignore Vertices Normal"); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); IgnoreVerticesTangent = GUILayout.Toggle(IgnoreVerticesTangent, " Ignore Vertices Tangent"); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } //---------------------------------------MeshSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); //---------------------------------------TerrainSetting------------------------------------------ TerrainSetting = GUILayout.Toggle(TerrainSetting, " Terrain Setting"); if (TerrainSetting) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); ConvertTerrain = GUILayout.Toggle(ConvertTerrain, " Convert Terrain To Mesh"); GUILayout.EndHorizontal(); if (ConvertTerrain) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(30)); terrainToMeshResolution = (TerrainToMeshResolution)EditorGUILayout.EnumPopup(" Resolution", terrainToMeshResolution); GUILayout.EndHorizontal(); } } //---------------------------------------TerrainSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); //---------------------------------------GameObjectSetting------------------------------------------ GameObjectSetting = GUILayout.Toggle(GameObjectSetting, " GameObject Setting"); if (GameObjectSetting) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); GUILayout.BeginVertical(GUILayout.ExpandWidth(true)); IgnoreNotActiveGameObject = GUILayout.Toggle(IgnoreNotActiveGameObject, " Ignore Not Active Game Objects"); if (FirstlevelMenu == 1) { BatchMade = GUILayout.Toggle(BatchMade, " Batch Make The First Level Game Objects"); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); } //---------------------------------------GameObjectSetting------------------------------------------ //---------------------------------------CompressTexture--------------------------------------- //miner GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); CompressTexture = GUILayout.Toggle(CompressTexture, " Assets platform"); if (CompressTexture) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); GUILayout.BeginVertical(GUILayout.ExpandWidth(true)); EditorGUI.BeginDisabledGroup(!HTTPClient.vip); Android = GUILayout.Toggle(Android, "Android(Need Year VIP)"); Ios = GUILayout.Toggle(Ios, "Ios(Need Year VIP)"); if (!HTTPClient.vip) { Android = false; Ios = false; } EditorGUI.EndDisabledGroup(); Conventional = GUILayout.Toggle(Conventional, " Conventional"); GUILayout.EndVertical(); GUILayout.EndHorizontal(); } GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); //---------------------------------------OtherSetting------------------------------------------ OtherSetting = GUILayout.Toggle(OtherSetting, " Other Setting"); if (OtherSetting) { GUILayout.BeginHorizontal(); GUILayout.Label("", GUILayout.Width(15)); GUILayout.BeginVertical(GUILayout.ExpandWidth(true)); //CoverOriginalFile = GUILayout.Toggle(CoverOriginalFile, " Cover Original Export Files"); GUILayout.BeginHorizontal(); CustomizeDirectory = GUILayout.Toggle(CustomizeDirectory, " Customize Export Root Directory Name", GUILayout.Width(250)); if (CustomizeDirectory) { CustomizeDirectoryName = GUILayout.TextField(CustomizeDirectoryName); } GUILayout.EndHorizontal(); AutoSave = GUILayout.Toggle(AutoSave, " Automatically Save The Configuration"); GUILayout.EndVertical(); GUILayout.EndHorizontal(); } //---------------------------------------OtherSetting------------------------------------------ GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); GUILayout.Label("Save Path", GUILayout.Width(65)); SAVEPATH = GUILayout.TextField(SAVEPATH, GUILayout.Height(21)); if (GUILayout.Button("Browse", GUILayout.MaxWidth(100), GUILayout.Height(22))) { SAVEPATH = EditorUtility.SaveFolderPanel("LayaUnityPlugin", "Assets", ""); } GUILayout.EndHorizontal(); GUILayout.Box("", GUILayout.Height(3), GUILayout.ExpandWidth(true)); GUILayout.BeginHorizontal(); GUILayout.Space(2f); if (GUILayout.Button("Clear Config", GUILayout.Height(22))) { clearConfiguration(); } if (GUILayout.Button("Revert Config", GUILayout.Height(22))) { readConfiguration(false); } if (GUILayout.Button("Save Config", GUILayout.Height(22))) { saveConfiguration(); } GUILayout.EndHorizontal(); GUILayout.Space(2f); GUILayout.Box("", GUILayout.Height(1), GUILayout.ExpandWidth(true)); GUILayout.Space(2f); GUILayout.BeginHorizontal(); if (GUILayout.Button("LayaAir Run", GUILayout.Height(26))) { LayaExport.DataManager.Type = 0; exportResource(true, 0, "/Conventional"); runLayaDemo(); } if (GUILayout.Button("LayaAir Export", GUILayout.Height(26))) { LayaExport.DataManager.Type = FirstlevelMenu; if (Ios) { exportResource(false, 1, "/IOS"); } if (Android) { exportResource(false, 2, "/Android"); } if (Conventional) { exportResource(false, 0, "/Conventional"); } } GUILayout.EndHorizontal(); GUILayout.Space(10f); EditorGUI.EndDisabledGroup(); }
/// <summary> /// Instantiates a named config parameter whose value is unset /// </summary> /// <param name="name">Name of the parameter as specified by ConfigEnum</param> public ConfigParameter(ConfigEnum name) { this.Id = (int)name; this.Name = Enum.GetName(typeof(ConfigEnum), name); }
public ConfigParameter(ConfigEnum name, String value) : this(name) { this.Value = value; }
/// <summary> /// 配置异常 /// </summary> /// <param name="config">配置信息</param> /// <param name="configName">配置名称</param> public ConfigException(ConfigEnum config = ConfigEnum.AppSetting, string configName = "") : base(string.Format(EnumCommon.GetDescription(config), string.IsNullOrEmpty(configName) ? "" : ",名称:" + configName)) { }