Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / ui / editorTools / EditorToolsPanel.cs
@小李xl 小李xl on 18 Mar 2023 1 KB 将编辑器插件接入ui系统
  1. using Generator;
  2. using Godot;
  3.  
  4. namespace UI.EditorTools;
  5.  
  6. [Tool]
  7. public partial class EditorToolsPanel : EditorTools
  8. {
  9. public override void OnShowUi(params object[] args)
  10. {
  11. L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_Button.Instance.Pressed += OnCreateUI;
  12. }
  13.  
  14. public override void OnHideUi()
  15. {
  16. L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_Button.Instance.Pressed -= OnCreateUI;
  17. }
  18.  
  19. private void OnCreateUI()
  20. {
  21. var text = L_ScrollContainer.L_MarginContainer.L_VBoxContainer.L_HBoxContainer3.L_LineEdit.Instance.Text;
  22. GD.PrintErr("ui名称: " + text);
  23. }
  24. private void OnCloseCreateUiConfirm()
  25. {
  26. //L_CreateUiConfirm.Instance.Hide();
  27. }
  28. /// <summary>
  29. /// 更新 ResourcePath
  30. /// </summary>
  31. private void _on_Button_pressed()
  32. {
  33. ResourcePathGenerator.Generate();
  34. }
  35.  
  36. /// <summary>
  37. /// 重新打包房间配置
  38. /// </summary>
  39. private void _on_Button2_pressed()
  40. {
  41. RoomPackGenerator.Generate();
  42. }
  43. }