Your code: typed or from a file
Each code board shows one piece of code. For a lesson about several files, add one board per file.
New to Unity? The basic terms (Scene, Hierarchy, Project window, Play mode) are explained in Before you start.
What you need
The code, either:
- typed or pasted into the tool, or
- a file:
.cs,.java,.c,.hor.py, anywhere on your computer or in the Project window.
Keep example code in the project
Save example code as a text file with an extra .txt, for example Student.cs.txt. Unity won't try to run it, and the tool still shows it as Student.cs and colours it as C#.
How it works
The code is copied onto the board. The board doesn't need the file afterwards, and nothing is read on the headset. If you change the file later, load it again.
The window
| Step | What you do there |
|---|---|
| 1 Code | Language, title and the code. Add the board. |
| 2 Appearance | Colours, sizes, line numbers, and what to leave out. |
| 3 Placement | Where the board stands: in the world or on an object. |
| 4 Save | Summary, save, remove. |
The list on the left shows every code board in the scene. Click one to change it. Changes appear in the scene straight away and can be undone with Ctrl+Z.