public void OnGUI() { if (differenceTextureGenerator.difference_texture_list == null) { return; } OnDiffTexGUI(); GUILayout.Space(12); if (GUILayout.Button(I18N.Instance().Get("difftex.button.generate_all"))) { GenerateAllDiffTex(); } }
private void OnDiffTexGUI() { for (int i = 0; i < differenceTextureGenerator.difference_texture_list.Length; i++) { if (i >= 1) { GUILayout.Space(8); } DifferenceTexture diffTex = differenceTextureGenerator.difference_texture_list[i]; GUILayout.Label("・" + I18N.Instance().Get(diffTex.name), styleTextureNameLabel); if (diffTex.description != null && diffTex.description != "") { GUIUtil.RenderLabel(I18N.Instance().Get(diffTex.description)); } for (int partsListCount = 0; partsListCount < diffTex.parts_list.Length; partsListCount++) { DifferenceParts diffParts = diffTex.parts_list[partsListCount]; GUILayout.Space(2); GUILayout.Label(I18N.Instance().Get(diffParts.name), stylePartsNameLabel); if (diffParts.description != null && diffParts.description != "") { GUIUtil.RenderLabel(I18N.Instance().Get(diffParts.description)); } List <string> selectGridList = new List <string>(); for (int selectGridCount = 0; selectGridCount < diffParts.texture_list.Length; selectGridCount++) { selectGridList.Add(I18N.Instance().Get(diffParts.texture_list[selectGridCount].name)); } GUILayout.Space(2); diffParts.select = GUILayout.SelectionGrid(diffParts.select, selectGridList.ToArray(), 3); } GUILayout.Space(8); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(I18N.Instance().Get("difftex.button.generate_tex") + I18N.Instance().Get(diffTex.name))) { GenerateDiffTex(diffTex); UpdateAssets(); } GUILayout.EndHorizontal(); } }
public void OnGUI() { if (differenceTextures == null) { return; } for (int i = 0; i < differenceTextures.Length; i++) { DifferenceTexture differenceTexture = differenceTextures[i]; GUILayout.Label(I18N.Instance().Get(differenceTexture.texture_name), titleLabelStyle); if (differenceTexture.parts_list != null) { for (int partsCount = 0; partsCount < differenceTexture.parts_list.Length; partsCount++) { DifferenceParts differenceParts = differenceTexture.parts_list[partsCount]; GUILayout.Label(I18N.Instance().Get(differenceParts.parts_name)); //SelectGrid用のリストを作る List <String> selectGridList = new List <String>(); for (int selectGridCount = 0; selectGridCount < differenceParts.texture_list.Length; selectGridCount++) { selectGridList.Add(I18N.Instance().Get(differenceParts.texture_list[selectGridCount].name)); } differenceParts.select = GUILayout.SelectionGrid(differenceParts.select, selectGridList.ToArray(), 3); GUILayout.Space(4); } if (GUILayout.Button(I18N.Instance().Get(differenceTexture.texture_name))) { GenerateDiffTex(i); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } } GUILayout.Space(16); } if (GUILayout.Button(I18N.Instance().Get("difftex.button.generate_all"))) { } }
//ExpandOptionのGUI処理 private void OnCustomOptionGUI() { if (expandOption.custom_options == null) { return; } for (int i = 0; i < expandOption.custom_options.Length; i++) { CustomOption customOption = expandOption.custom_options[i]; //オプションが非表示の場合 if (customOption.is_not_visible_option) { return; } GUILayout.Space(4); switch (customOption.option_type.ToLower()) { case "toggle": customOption.is_check = GUILayout.Toggle(customOption.is_check, I18N.Instance().Get(customOption.name)); break; case "grid": GUILayout.Label(I18N.Instance().Get(customOption.name)); //GUI用の文字列リストを作る List <string> selectGridList = new List <string>(); //CustomOptionのgrid_listから名前を取り出し文字列リストに追加 for (int selectGridCount = 0; selectGridCount < customOption.grid_list.Length; selectGridCount++) { selectGridList.Add(I18N.Instance().Get(customOption.grid_list[selectGridCount].name)); } //GUI表示。処理するときにはselect(index)を使ってCustomOptionのgrid_listから取り出す customOption.select = GUILayout.SelectionGrid(customOption.select, selectGridList.ToArray(), 3); break; } //適用ボタン表示のフィルター処理 bool filterPassed = false; if (customOption.apply_filter != null && PrefabData.GetAvatar() != null) { for (int filterCount = 0; filterCount < customOption.apply_filter.Length; filterCount++) { Transform filterObject = PrefabData.GetAvatar().transform.Find(customOption.apply_filter[filterCount]); if (filterObject != null) { filterPassed = true; } } } if (customOption.display_apply_button && filterPassed) { GUILayout.Space(4); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(I18N.Instance().Get("option.button.apply") + ": " + I18N.Instance().Get(customOption.name), new GUILayoutOption[] { GUILayout.MinWidth(200) })) { RunCustomOption(customOption); } EditorGUILayout.EndHorizontal(); } } }
public void OnAdvancedOptionGUI() { isDeleteIsEditorOnlyTag = GUILayout.Toggle(isDeleteIsEditorOnlyTag, I18N.Instance().Get("option.toggle.delete_is_set_editor_only_tag")); GUILayout.Label(I18N.Instance().Get("option.toggle.delete_is_set_editor_only_tag.description")); }
public void OnGUI() { //8のマージン GUILayout.Space(8); //不要なオブジェクトを削除 if (expandOption.unnecessary_objects != null) { if (expandOption.unnecessary_objects.Length > 0) { isDeleteUnnecessaryObject = GUILayout.Toggle(isDeleteUnnecessaryObject, I18N.Instance().Get("option.toggle.is_delete_unnecessary_object")); } } OnCustomOptionGUI(); GUILayout.Space(4); }
//引数のCustomOptionをGUIで描画する private void OnCustomOptionGUI(CustomOption customOption) { if (!customOption.visible_option) { return; } switch (customOption.option_type.ToLower()) { case "toggle": customOption.is_check = GUILayout.Toggle(customOption.is_check, " " + I18N.Instance().Get(customOption.name)); if (customOption.description != null && customOption.description != "") { GUIUtil.RenderLabel(I18N.Instance().Get(customOption.description)); } break; case "grid": GUILayout.Label(I18N.Instance().Get(customOption.name)); if (customOption.description != null && customOption.description != null) { GUIUtil.RenderLabel(I18N.Instance().Get(customOption.description)); } //GUI用の文字列リストを作る List <string> selectGridList = new List <string>(); //CustomOptionのgrid_listから名前を取り出し文字列リストに追加 for (int selectGridCount = 0; selectGridCount < customOption.grid_list.Length; selectGridCount++) { selectGridList.Add(I18N.Instance().Get(customOption.grid_list[selectGridCount].name)); } //GUI表示。処理するときにはselect(index)を使ってCustomOptionのgrid_listから取り出す customOption.select = GUILayout.SelectionGrid(customOption.select, selectGridList.ToArray(), 3); GUILayout.Space(1); break; } //適用ボタン表示のフィルター処理 bool filterPassed = false; if (customOption.apply_filter != null && PrefabData.GetAvatar() != null) { for (int filterCount = 0; filterCount < customOption.apply_filter.Length; filterCount++) { string filterObjectName = customOption.apply_filter[filterCount]; if (!customOption.apply_filter_is_avatar_object) { filterObjectName = AppendID(filterObjectName); } Transform filterObject = PrefabData.GetAvatar().transform.Find(filterObjectName); if (filterObject != null) { filterPassed = true; } } } if (filterPassed) { GUILayout.Space(4); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(I18N.Instance().Get("option.button.apply") + ": " + I18N.Instance().Get(customOption.name), new GUILayoutOption[] { GUILayout.MinWidth(200) })) { ProcessCustomOption(customOption); } EditorGUILayout.EndHorizontal(); } GUILayout.Space(3); }