Keywords: Unity, Basic Usage

Assets

Import

Q: How to open .unitypackage file?
A: Menu: Assets -> Import Package -> Custom Package.

Scene

Q: How to create scene? A: Project Panel -> Create -> Scene.

Scene asset file:

Or: Right click in Project Panel -> Create -> Scene

GameObject

Script

Q:How to create GameObject?
A:Hierarchy Panel -> Creat -> Create Empty.

GameOjbect in scene:

Q:How to create C# script?
A:Project Panel -> Create -> C# Script.

C# Script file:

Q:How to attach script on GameObject?
A:Select GameObject in Hierarchy panel, then click Add Component -> Scripts -> Select C# script file.

Debug

Debug in Visual Studio

Q:How to debug C# Script in Visual Studio?
A:

  1. Install Visual Studio Tools for Unity: check Game development with Unity in installation detail window of Visual Studio.

    Microsoft Visual Studio Tools for Unity enabled would be shown in Unity Editor About panel when installation is finished.

  2. Edit -> Preferences -> External Tools -> Set External Script Editor as Visual Studio.

  3. Click Attach to Unity, then run game in editor, breakpoint would be trigger in Visual Studio.

    Or you can click Attach to Unity and Play, game would be run from Visual Studio.

Use Visual Studio Tools for Unity
https://docs.microsoft.com/en-us/visualstudio/cross-platform/using-visual-studio-tools-for-unity?view=vs-2019

Get started with Visual Studio Tools for Unity
https://docs.microsoft.com/en-us/visualstudio/cross-platform/getting-started-with-visual-studio-tools-for-unity?view=vs-2019


No person deserves your tears, and who deserves them won't make you cry. ― Gabriel García Márquez