protected override void OnLeave(ProcedureOwner procedureOwner, bool isShutdown)
    {
        base.OnLeave(procedureOwner, isShutdown);

        // 取消订阅
        GameEntry.Event.Unsubscribe(OpenUIFormSuccessEventArgs.EventId, OnOpenUIFormSuccess);

        // 停止音乐
        GameEntry.Sound.StopMusic();

        // 关闭UI
        if (uiPlayerOperate != null)
        {
            GameEntry.UI.CloseUIForm(uiPlayerOperate.UIForm);
            uiPlayerOperate = null;
        }

        if (uiPlayerMessage != null)
        {
            GameEntry.UI.CloseUIForm(uiPlayerMessage.UIForm);
            uiPlayerMessage = null;
        }

        if (uiGameOver != null)
        {
            GameEntry.UI.CloseUIForm(uiGameOver.UIForm);
        }
    }
    private void OnOpenUIFormSuccess(object sender, GameEventArgs e)
    {
        OpenUIFormSuccessEventArgs ne = (OpenUIFormSuccessEventArgs)e;

        if (ne.UIForm.Logic is UIPlayerOperate)
        {
            uiPlayerOperate = (UIPlayerOperate)ne.UIForm.Logic;
        }
        else if (ne.UIForm.Logic is UIPlayerMessage)
        {
            uiPlayerMessage = (UIPlayerMessage)ne.UIForm.Logic;
        }
        else if (ne.UIForm.Logic is UIGameOver)
        {
            uiGameOver = (UIGameOver)ne.UIForm.Logic;
        }
    }