使用 Visual Studio Tools for Unity 設計程式Program Visual Studio Tools for Unity

在本節中,您將找到使用 Visual Studio Tools for Unity 應用程式開發介面的範例。In this section, you'll find examples for using the Visual Studio Tools for Unity API.

範例Examples

以下是一些範例,示範如何使用 Visual Studio Tools for Unity 應用程式開發介面。Here are some examples that show how you can use the Visual Studio Tools for Unity APIs.

自訂 VSTU 所建立的專案檔Customize project files created by VSTU

Visual Studio Tools for Unity 在專案檔產生期間提供 Unity 樣式回呼。Visual Studio Tools for Unity provides a Unity-style callback during project file generation. 若要瞭解如何在每次重新產生專案檔時進行修改,請參閱 範例:產生專案檔。To learn how you can modify the project file whenever it's regenerated, see Example: Project file generation.

與 VSTU 共用 Unity 記錄回呼Share the Unity log callback with VSTU

Visual Studio Tools for Unity 使用 Unity 註冊記錄回呼,以便將其主控台串流至 Visual Studio。Visual Studio Tools for Unity registers a log callback with Unity to be able to stream its console to Visual Studio. 如果您的編輯器指令碼也使用 Unity 註冊記錄回呼,VSTU 回呼可能會與這個回呼相衝突。If your editor scripts also register a log callback with Unity, the VSTU callback might interfere with it. 若要瞭解如何與 VSTU 共用 Unity 記錄回呼,請參閱 範例:記錄回呼To learn how you can share the Unity log callback with VSTU, see Example: Log callback.