private void OnSaveInfo(EButton button) { BuffTemplateInfo info = ScriptableObjectHelper.Create <BuffTemplateInfo>(); info.desc = ""; info.id = _buff_id_input.Value; info.duration = _buff_id_input.Value; info.interval_time = interval_time_input.Value; info.max_layer = max_layer_input.Value; info._effs.Clear(); List <ERect> effect_list = _scroll_view.GetChilds(); for (int i = 0; i < effect_list.Count; i++) { EEffectInfoItem item = effect_list[i] as EEffectInfoItem; if (item == null) { continue; } EffectTemplateInfo eff_info = item.GetValue(); info._effs.Add(eff_info); } AssetDatabase.CreateAsset(info, "Assets/Resources/test_buff_dat.asset"); //ScriptableObjectHelper.Save<BuffTemplateInfo>(info, "Assets/Resources", "test_buff_dat"); }
public void SetInfo(string[] titles, float[] titles_width, int max_size) { ERect first = null; for (int i = 0; i < titles.Length; i++) { EButton title_btn = new EButton(titles[i], titles_width[i]); _title_btns.Add(title_btn); if (first == null) { AddComponent(title_btn, 2, 5); } else { AddComponentRight(title_btn, first, 0); } first = title_btn; } _scrollview = new EScrollView(Ew, Eh - DEFAULT_HEIGHT * 2 - 20); AddComponent(_scrollview, 0, DEFAULT_HEIGHT + 10); _scrollview.SetHeightInterval(2); _page_item = new ExtendPageItem(); _page_item.SetPageInfo(100, 10); AddComponent(_page_item, E_Anchor.DOWN_CENTER); _page_item.ResetPosition(_page_item.Ex, _page_item.Ey - 5); _page_item.OnUpdatePage += _on_update_page; }
public void OnloadRuleBtn(EButton button) { List <System.Object> rules = new List <System.Object>(); //1. 导入并且初始化规则 //2. 细分类型-->过滤文件-->设置规则 TextAsset textAsset = AssetDatabase.LoadAssetAtPath <TextAsset>(AssetFormatConst.RULE_ASSET_PATH); ResMd resMd = new ResMd(); resMd.ParseText(textAsset.text); EdNode ruleNode = resMd._root_node.GetNode("Rule"); List <EdNode> nodes = ruleNode.Nodes; int length = nodes.Count; for (int i = 0; i < length; i++) { EdNode node = nodes[i]; AssetFormatRule rule = AssetFormatRule.CreateFormatRule(node); if (rule != null) { rules.Add(rule); } } _texRuleTablePanel.RefreshData(rules); _shows.Clear(); _texShowTable.RefreshData(_shows); }
public void OnClick(EButton button) { if (on_action != null) { on_action(button._text); } }
private void AddTargetFilter(EButton button) { ETargetItem item = new ETargetItem(_scrollview.Ew - 30, 30); item.SetData(GetInof()); _scrollview.AddItem(item); item.Init(); item._remove_btn.OnClick += OnRemoveItem; }
public void _init() { _target_filter_btn = new EButton("增加过滤类型", 100); _target_popup = new EStringPopup("", 200); _target_popup.SetData(GetInof()); _scrollview = new EScrollView(Ew - 20, Eh - 50); _scrollview.SetColor(Color.black); }
private void AddEffect(EButton button) { string data = _effect_popup.GetData(); E_EffectType eff_type = (E_EffectType)Enum.Parse(typeof(E_EffectType), data); EEffectInfoItem effect_info_item = new EEffectInfoItem(Ew - 70, 460, eff_type); //AddComponent(effect_info_item, 10, _des_text_area.Ey + _des_text_area.Eh / 2 + 5); _scroll_view.AddItem(effect_info_item); }
public void InitInfo(List <string> names) { float tmp_y = 5; for (int i = 0; i < names.Count; i++) { EButton button = new EButton(names[i], Ew - 5); button.OnClick += OnClick; AddComponent(button, 5, tmp_y); tmp_y += button.Size.y + 5; } }
public void CheckSeoAnimation(EButton button) { try { AnimationSeoE.AllSeoAnimation(); UnityEditor.EditorUtility.DisplayDialog("执行成功", "动画内存优化(针对AnimationClip)", "Ok"); } catch (Exception e) { UnityEditor.EditorUtility.DisplayDialog("执行失败", e.Message, "Ok"); } }
private void ClickSwparationAnimation(EButton button) { try { AnimationSeparationE.AllSeparationAnimationByFbx(); UnityEditor.EditorUtility.DisplayDialog("执行成功", "分离动画(针对Fbx)", "Ok"); } catch (Exception e) { UnityEditor.EditorUtility.DisplayDialog("执行失败", e.Message, "Ok"); } }
public void CheckCheckDcBtn(EButton button) { try { EditorEffectCheckHelper.CheckEffectDrawCall(); UnityEditor.EditorUtility.DisplayDialog("执行成功", "特效Dc个数", "Ok"); } catch (Exception e) { UnityEditor.EditorUtility.DisplayDialog("执行失败", e.Message, "Ok"); } }
private void ClickCsvToCs(EButton button) { try { CodeGenerator.CreateCode(); UnityEditor.EditorUtility.DisplayDialog("Csv生成cs文件成功", "", "Ok"); } catch (Exception e) { UnityEngine.Debug.Log(e.Message); UnityEditor.EditorUtility.DisplayDialog("Csv生成cs文件失败", e.Message, "Ok"); } }
private void ClickCheckTexRef(EButton button) { try { EditorEffectCheckHelper.CheckEffectTexture(); UnityEditor.EditorUtility.DisplayDialog("执行成功", "特效纹理引用", "Ok"); } catch (Exception e) { UnityEngine.Debug.Log(e); UnityEditor.EditorUtility.DisplayDialog("执行失败", e.Message, "Ok"); } }
public void _init() { _des = new ETextArea(_size.x - 100, 100); _des.SetInfo( "1.特效纹理引用\n" + "2.特效Dc个数\n"); _check_tex_ref_btn = new EButton("特效纹理引用", 120); _check_tex_ref_btn.OnClick += ClickCheckTexRef; _check_dc_btn = new EButton("特效Dc个数", 120); _check_dc_btn.OnClick += CheckCheckDcBtn; _init_position(); }
public void _init() { _des = new ETextArea(_size.x - 100, 100); _des.SetInfo( "1.分离动画\n" + "2.动画内存优化\n"); _swparation_animation_btn = new EButton("分离动画(针对Fbx)", 120); _swparation_animation_btn.OnClick += ClickSwparationAnimation; _seo_animation = new EButton("动画内存优化(针对AnimationClip)", 240); _seo_animation.OnClick += CheckSeoAnimation; _init_position(); }
public void _init(EditorWindow win) { _rootPath = new ELabelInput("文件名:", 80, "", 400); _searchFileBtn = new EButton("文件名检索", 150); _searchFileBtn.OnClick += OnSearchFileByPath; ERect item = _rootPath; AddComponent(_rootPath, 5, 5); item = AddComponentRight(_searchFileBtn, item); _effectTable = new TableView(win, typeof(CheckEffectReportCnf)); _effectTable.OnSelected += OnRuleSelected; _effectTable.AddColumn("_assetPath", CheckEffectReportCnf.ASSET_PATH, 0.4f); _effectTable.AddColumn("_effName", CheckEffectReportCnf.EFFECT_NAME, 0.15f); _effectTable.AddColumn("_loadTime", CheckEffectReportCnf.LOAD_TIME, 0.05f); _effectTable.AddColumn("_instTime", CheckEffectReportCnf.INST_TIME, 0.05f); _effectTable.AddColumn("_dc", CheckEffectReportCnf.DRAWCALL, 0.05f); _effectTable.AddColumn("_triangles", CheckEffectReportCnf.TRIANGLES, 0.05f); _effectTable.AddColumn("_materialCount", CheckEffectReportCnf.MATERIAL_COUNT, 0.05f); _effectTable.AddColumn("_totalPsCount", CheckEffectReportCnf.TOTAL_PS_COUNT, 0.05f); _effectTable.AddColumn("_texMemBytes", CheckEffectReportCnf.TEX_MEM_BYTES, 0.05f); _effectTable.AddColumn("_texMemCount", CheckEffectReportCnf.TEX_MEM_COUNT, 0.05f); _effectTable.AddColumn("_animationCount", CheckEffectReportCnf.ANIM_COUNT, 0.05f); _effectTablePanel = new TableViewPanel(Ew - 10, 200); _effectTablePanel.AddTableView(_effectTable); _effectTablePanel.RefreshData(_shows); AddComponent(_effectTablePanel, 5, 10 + _rootPath.Eh); _effectTexTable = new TableView(win, typeof(TmpStringInfo)); _effectTexTable.AddColumn("_param1", "路径", 0.45f, TextAnchor.MiddleLeft); _effectTexTable.AddColumn("_param2", "内存占用", 0.05f, TextAnchor.MiddleCenter); _effectTexTablePanel = new TableViewPanel(Ew - 10, Eh - 10 - _rootPath.Eh - _effectTablePanel.Eh); _effectTexTablePanel.AddTableView(_effectTexTable); AddComponentDown(_effectTexTablePanel, _effectTablePanel); }
public void OnFormatBtn(EButton button) { if (_formatRule == null) { return; } int length = _shows.Count; for (int i = 0; i < length; i++) { TextureFormatInfo info = _shows[i] as TextureFormatInfo; Texture2D tex2D = AssetDatabase.LoadAssetAtPath <Texture2D>(info.Path); _formatRule.ApplySettings <Texture>(tex2D, info.Path); EditorUtility.DisplayProgressBar("格式化纹理", info.Path, (float)(i + 1) / length); } EditorUtility.ClearProgressBar(); OnRuleSelected(_formatRule, 0); }
public void _init(EditorWindow win) { _rootPath = new ELabelInput("根目录:", 80, "", 400); _searchBtn = new EButton("根据目录检索", 150); _serchAllBtn = new EButton("检索所有目录", 150); _loadRuleBtn = new EButton("加载纹理规则", 150); _formatBtn = new EButton("格式化纹理", 150); _searchBtn.OnClick += OnSearchByPath; _serchAllBtn.OnClick += OnSearchAll; _loadRuleBtn.OnClick += OnloadRuleBtn; _formatBtn.OnClick += OnFormatBtn; ERect item = _rootPath; AddComponent(_rootPath, 5, 5); item = AddComponentRight(_searchBtn, item); item = AddComponentRight(_serchAllBtn, item); item = AddComponentRight(_loadRuleBtn, item); item = AddComponentRight(_formatBtn, item); _texRuleTable = new TableView(win, typeof(AssetFormatRule)); _texRuleTable.OnSelected += OnRuleSelected; _texRuleTable.AddColumn("FilterPath", "过滤的路径", 0.45f); _texRuleTable.AddColumn("FilterRule", "过滤规则", 0.35f); _texRuleTable.AddColumn("FormatRule", "格式化", 0.25f); _texRuleTablePanel = new TableViewPanel(Ew - 10, 200); _texRuleTablePanel.AddTableView(_texRuleTable); AddComponent(_texRuleTablePanel, 5, 10 + _rootPath.Eh); _texShowTable = new TableView(win, typeof(TextureFormatInfo)); _texShowTable.OnSelected += OnInfoSelected; _texShowTable.AddColumn("Path", "路径", 0.35f, TextAnchor.MiddleLeft); _texShowTable.AddColumn("MemSize", "内存占用", 0.05f, TextAnchor.MiddleCenter, "<fmt_bytes>"); _texShowTable.AddColumn("ReadWriteEnable", "R/W", 0.05f); _texShowTable.AddColumn("MipmapEnable", "Mipmap", 0.05f); _texShowTable.AddColumn("IsSpriteTag", "图集(和Format冲突)", 0.1f); _texShowTable.AddColumn("AndroidFormat", "AndroidFormat", 0.1f); _texShowTable.AddColumn("IosFormat", "IosFormat", 0.1f); _texShowTable.AddColumn("ImportType", "纹理格式", 0.1f); _texShowTable.AddColumn("ImportShape", "ImportShape", 0.1f); _texShowTablePanel = new TableViewPanel(Ew - 10, Eh - 10 - _rootPath.Eh - _texRuleTablePanel.Eh); _texShowTablePanel.AddTableView(_texShowTable); AddComponentDown(_texShowTablePanel, _texRuleTablePanel); }
public void _init() { _des = new ETextArea(_size.x - 100, 100); _des.SetInfo( "1.csv生成Obj文件: 通过Csv生成对应的脚本,如果你修改了Table\\*.csv 中头四行的内容信息。那么你就需要重新生成cs代码\n" + "2.配置表有效性检测: 检测Csv表格中的数据的有效性\n"); _csv_to_cs_btn = new EButton("Csv生成Cs代码", 120); _csv_to_cs_btn.OnClick += ClickCsvToCs; _csv_to_byte_btn = new EButton("生成二进制数据", 120); _csv_to_byte_btn.OnClick += ClickToByte; _check_byte_btn = new EButton("生成二进制数据", 120); _check_byte_btn.OnClick += ClickCheckByte; _check_csv_vaild = new EButton("配置表有效性检测", 120); _check_csv_vaild.OnClick += ClickCheckCsvVaild; _init_position(); }
public void _init() { _buff_id_input = new ELabelIntInput("模板Id", 70, 1001, 200); _des_title_lab = new ELabel("模板描述", 70); _des_text_area = new ETextArea(200, 18 * 4); _add_effect_btn = new EButton("添加效果", 70); _add_effect_btn.OnClick += AddEffect; _effect_popup = new EEnumPopup(200); _effect_popup.SetData(E_EffectType.attribute); duration_input = new ELabelIntInput("持续时间(ms)", 100, 1000, 100); interval_time_input = new ELabelIntInput("间隔时间(ms)", 100, 1000, 100); max_layer_input = new ELabelIntInput("最大层级", 100, 1, 100); _scroll_view = new EScrollView(Ew - 20, Eh - 100); _save_btn = new EButton("保存", 50); _save_btn.OnClick += OnSaveInfo; //_scroll_view.SetBg(true); }
public void _init() { _title_lab = new ELabel("效果描述:", 70); _des_text_area = new ETextArea(270, 18 * 3); _trigger_item = new ETriggerItem(Ew - 20, 55); _target_select_item = new ETargetSelectorItem(Ew - 20, 200); _overlay_lab = new ELabel("叠加效果:", 70); _overlay_popup = new EEnumPopup(200); _overlay_popup.SetData(E_EffectOverlayType.can_overlay_can_refresh); _remove_btn = new EButton("X", 20); if (_eff_type == E_EffectType.attribute) { _e_component = new EAttributeItem(Ew - 20, 115); } else if (_eff_type == E_EffectType.value) { _e_component = new EValueItem(Ew - 20, 115); } }
private void OnSearchAll(EButton button) { OnSearchTextures(Application.dataPath); }
private void OnSearchFileByPath(EButton button) { string searchPath = _rootPath.Text; OnSearchTextures(searchPath); }
private void OnRemoveItem(EButton button) { //_scrollview.Remove(); }
public EStringPopup _target_popup; // 过滤类型 下拉列表 public ETargetItem(float width, float height) : base(width, height) { _remove_btn = new EButton("X", 20); }
public void ClickCheckByte(EButton button) { CodeGenerator.ReadByte(); }
private void OnSearchByPath(EButton button) { string searchPath = _rootPath.Text; OnSearchTextures(Application.dataPath + "/" + searchPath); }
private void ClickCheckCsvVaild(EButton button) { TableManager.CheckVaild(); }
public void ClickToByte(EButton button) { StaticCnf.Clear(); ConfigManager.ReadLocalConfig(); ConfigManager.WriteByteConfig(); }