Files
godot-docs-l10n/classes/zh_Hant/class_editordebuggersession.rst

210 lines
9.9 KiB
ReStructuredText

:github_url: hide
.. _class_EditorDebuggerSession:
EditorDebuggerSession
=====================
**繼承:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
與編輯器除錯器互動的類。
.. rst-class:: classref-introduction-group
說明
----
This class cannot be directly instantiated and must be retrieved via an :ref:`EditorDebuggerPlugin<class_EditorDebuggerPlugin>`.
You can add tabs to the session UI via :ref:`add_session_tab()<class_EditorDebuggerSession_method_add_session_tab>`, send messages via :ref:`send_message()<class_EditorDebuggerSession_method_send_message>`, and toggle :ref:`EngineProfiler<class_EngineProfiler>`\ s via :ref:`toggle_profiler()<class_EditorDebuggerSession_method_toggle_profiler>`.
.. rst-class:: classref-reftable-group
方法
----
.. table::
:widths: auto
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`add_session_tab<class_EditorDebuggerSession_method_add_session_tab>`\ (\ control\: :ref:`Control<class_Control>`\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_active<class_EditorDebuggerSession_method_is_active>`\ (\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_breaked<class_EditorDebuggerSession_method_is_breaked>`\ (\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_debuggable<class_EditorDebuggerSession_method_is_debuggable>`\ (\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`remove_session_tab<class_EditorDebuggerSession_method_remove_session_tab>`\ (\ control\: :ref:`Control<class_Control>`\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`send_message<class_EditorDebuggerSession_method_send_message>`\ (\ message\: :ref:`String<class_String>`, data\: :ref:`Array<class_Array>` = []\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_breakpoint<class_EditorDebuggerSession_method_set_breakpoint>`\ (\ path\: :ref:`String<class_String>`, line\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`toggle_profiler<class_EditorDebuggerSession_method_toggle_profiler>`\ (\ profiler\: :ref:`String<class_String>`, enable\: :ref:`bool<class_bool>`, data\: :ref:`Array<class_Array>` = []\ ) |
+-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
訊號
----
.. _class_EditorDebuggerSession_signal_breaked:
.. rst-class:: classref-signal
**breaked**\ (\ can_debug\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorDebuggerSession_signal_breaked>`
當連接的遠端實例進入中斷狀態時發出。如果 ``can_debug````true``\ ,則遠端實例將進入除錯迴圈。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_signal_continued:
.. rst-class:: classref-signal
**continued**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_signal_continued>`
當連接的遠端實例退出中斷狀態時觸發。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_signal_started:
.. rst-class:: classref-signal
**started**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_signal_started>`
當一個遠端實例連接到該會話時觸發(即該會話成為活動狀態)。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_signal_stopped:
.. rst-class:: classref-signal
**stopped**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_signal_stopped>`
當一個遠端實例從該會話中分離出來時(即該會話變為非活動狀態)發出。
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
方法說明
--------
.. _class_EditorDebuggerSession_method_add_session_tab:
.. rst-class:: classref-method
|void| **add_session_tab**\ (\ control\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_EditorDebuggerSession_method_add_session_tab>`
Adds the given ``control`` to the debug session UI in the debugger bottom panel. The ``control``'s node name will be used as the tab title.
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_is_active:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_active**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_method_is_active>`
如果除錯會話附加到了某個遠端實例,則返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_is_breaked:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_breaked**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_method_is_breaked>`
如果附加的遠端實例正處於除錯迴圈中,則返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_is_debuggable:
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_debuggable**\ (\ ) :ref:`🔗<class_EditorDebuggerSession_method_is_debuggable>`
如果附加的遠端實例可以除錯,則返回 ``true``\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_remove_session_tab:
.. rst-class:: classref-method
|void| **remove_session_tab**\ (\ control\: :ref:`Control<class_Control>`\ ) :ref:`🔗<class_EditorDebuggerSession_method_remove_session_tab>`
將給定的控制項 ``control`` 從底部除錯器面板的除錯會話 UI 中移除。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_send_message:
.. rst-class:: classref-method
|void| **send_message**\ (\ message\: :ref:`String<class_String>`, data\: :ref:`Array<class_Array>` = []\ ) :ref:`🔗<class_EditorDebuggerSession_method_send_message>`
向原生實例發送給定的消息 ``message``\ ,還可以傳入額外的資料 ``data``\ 。如何獲取這些消息見 :ref:`EngineDebugger<class_EngineDebugger>`\ 。
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_set_breakpoint:
.. rst-class:: classref-method
|void| **set_breakpoint**\ (\ path\: :ref:`String<class_String>`, line\: :ref:`int<class_int>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_EditorDebuggerSession_method_set_breakpoint>`
Enables or disables a specific breakpoint based on ``enabled``, updating the Editor Breakpoint Panel accordingly.
.. rst-class:: classref-item-separator
----
.. _class_EditorDebuggerSession_method_toggle_profiler:
.. rst-class:: classref-method
|void| **toggle_profiler**\ (\ profiler\: :ref:`String<class_String>`, enable\: :ref:`bool<class_bool>`, data\: :ref:`Array<class_Array>` = []\ ) :ref:`🔗<class_EditorDebuggerSession_method_toggle_profiler>`
在所附加的遠端實例上開關給定的 ``profiler``\ ,還可以傳入額外的資料 ``data``\ 。詳見 :ref:`EngineProfiler<class_EngineProfiler>`\ 。
.. |virtual| replace:: :abbr:`virtual (本方法通常需要使用者覆寫才能生效。)`
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
.. |const| replace:: :abbr:`const (本方法沒有副作用。不會修改該實例的任何成員變數。)`
.. |vararg| replace:: :abbr:`vararg (本方法除了這裡描述的參數外,還可以接受任意數量的參數。)`
.. |constructor| replace:: :abbr:`constructor (本方法用於建構一個型別。)`
.. |static| replace:: :abbr:`static (本方法無需實例即可呼叫,因此可以直接使用類別名稱呼叫。)`
.. |operator| replace:: :abbr:`operator (本方法描述將本型別作為左運算元時可用的有效運算子。)`
.. |bitfield| replace:: :abbr:`BitField (此值是由下列旗標組成的位元遮罩整數。)`
.. |void| replace:: :abbr:`void (無回傳值。)`