Newer
Older
DungeonShooting / DungeonShooting_Godot / src / game / ui / mapEditorMapMark / EditorMarkWaveCell.cs
@小李xl 小李xl on 5 Aug 2023 884 bytes 完善UiCell类
namespace UI.MapEditorMapMark;

public class EditorMarkWaveCell : UiCell<MapEditorMapMark.WaveTemplate, object>
{
    public override void OnInit()
    {
        CellNode.L_HBoxContainer.L_TextureButton.Instance.Pressed += OnExpandOrClose;
    }

    //展开/收起按钮点击
    private void OnExpandOrClose()
    {
        var textureButton = CellNode.L_HBoxContainer.L_TextureButton.Instance;
        var marginContainer = CellNode.L_MarginContainer.Instance;
        var flag = !marginContainer.Visible;
        marginContainer.Visible = flag;
        if (flag)
        {
            textureButton.TextureNormal = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Down_png);
        }
        else
        {
            textureButton.TextureNormal = ResourceManager.LoadTexture2D(ResourcePath.resource_sprite_ui_commonIcon_Left_png);
        }
    }
}