TExcelTAD
Home › Unity with C# › The Editor, Scenes & Project Folders

The Editor, Scenes & Project Folders

The Unity editor is a set of dockable windows around one idea: a scene full of GameObjects, and a project full of assets those objects use. This lesson tours the windows, explains scenes, and shows what the folders of a Unity project are for, including the .meta files that new users delete by accident.

The main windows

Window What it shows
Hierarchy every GameObject in the open scenes, as a parent/child tree
Scene view the editable 3D view of the scene. Move with right-click + WASD, focus a selection with F
Game view what the active camera renders, i.e. what the player sees in Play mode
Inspector the components of the selected object or the import settings of the selected asset
Project the files under Assets/ and Packages/
Console logs, warnings and errors; double-click an entry to jump to the code

Tools on the Scene view toolbar: W move, E rotate, R scale, T rect tool. Hold V while moving to snap vertex-to-vertex.

Warning: Changes you make in Play mode are lost when you stop. Set a Play mode tint in Preferences > Colors so you notice. To keep a value you tuned, right-click the component header and choose Copy Component, stop, then Paste Component Values.

Scenes

A scene (.unity file) is a level, a menu or any self-contained chunk of the game. You can load several at once, which large projects use to split a level into gameplay, lighting and UI scenes.

csharp
using UnityEngine;
using UnityEngine.SceneManagement;

public class LevelLoader : MonoBehaviour
{
    public void LoadLevel(string sceneName)
    {
        // The scene must be in the active build profile's scene list.
        SceneManager.LoadSceneAsync(sceneName);                       // replaces the open scenes
    }

    public void AddUiScene()
    {
        SceneManager.LoadSceneAsync("HUD", LoadSceneMode.Additive);   // loads on top
    }
}

When a new scene loads in single mode, every GameObject in the old scenes is destroyed, unless it was marked with DontDestroyOnLoad(gameObject).

Project folders

text
MyGame/
├── Assets/            your files: scenes, scripts, models, textures, audio. Commit it.
├── Packages/          manifest.json + packages-lock.json: which packages and versions. Commit it.
├── ProjectSettings/   input, physics, quality, tags, player settings. Commit it.
├── Library/           the import cache Unity rebuilds from Assets. Never commit it.
├── Temp/, Logs/, obj/ build and editor scratch. Never commit.
└── UserSettings/      your personal editor layout and preferences. Usually not committed.

Inside Assets/, any organization works, but pick one and stick to it. A common layout is by feature (Assets/_Game/Player/, Assets/_Game/Enemies/), with third-party assets kept in their own folders so updates don't mix with your work. A few folder names are special: Editor/ (editor-only scripts, not included in builds), Resources/ (always included in builds and loadable by name; avoid it for large content, see Addressables) and StreamingAssets/ (copied as-is into the build).

.meta files and GUIDs

Every file and folder in Assets/ gets a sibling .meta file holding a GUID and the import settings. Scenes and prefabs reference assets by GUID, not by path. That is why you can rename or move an asset inside the Unity Project window and nothing breaks. It is also why moving files in Windows Explorer or Finder without their .meta files, or forgetting to commit a .meta, breaks references: Unity generates a new GUID and every scene that used the old one now shows "Missing".

The model below stores references by GUID and shows both cases:

csharp · try it yourself
using System;
using System.Collections.Generic;

var assetDb = new AssetDatabase();
string rockGuid = assetDb.Import("Assets/Art/rock.fbx");
var scene = new Dictionary<string, string> { ["Boulder.mesh"] = rockGuid };   // the scene stores a GUID

assetDb.Move("Assets/Art/rock.fbx", "Assets/Environment/rock_big.fbx");      // moved in Unity: .meta moves too
Console.WriteLine(
quot;after Unity move: Boulder.mesh -> {assetDb.Resolve(scene["Boulder.mesh"])}"); assetDb.DeleteMetaAndReimport("Assets/Environment/rock_big.fbx"); // moved outside Unity without .meta Console.WriteLine(
quot;after lost .meta: Boulder.mesh -> {assetDb.Resolve(scene["Boulder.mesh"])}"); class AssetDatabase { readonly Dictionary<string, string> pathByGuid = new(); int next = 0xA1; public string Import(string path) { string guid =
quot;{next++:x4}c0ffee"; // real GUIDs are 32 hex digits pathByGuid[guid] = path; Console.WriteLine(
quot;import {path} -> guid {guid}"); return guid; } public void Move(string from, string to) { foreach (var (guid, path) in pathByGuid) if (path == from) { pathByGuid[guid] = to; return; } } public void DeleteMetaAndReimport(string path) { foreach (var (guid, p) in pathByGuid) if (p == path) { pathByGuid.Remove(guid); break; } Import(path); // same file, brand-new GUID } public string Resolve(string guid) => pathByGuid.TryGetValue(guid, out var p) ? p : "Missing (Mesh)"; }
import Assets/Art/rock.fbx -> guid 00a1c0ffee
after Unity move:   Boulder.mesh -> Assets/Environment/rock_big.fbx
import Assets/Environment/rock_big.fbx -> guid 00a2c0ffee
after lost .meta:   Boulder.mesh -> Missing (Mesh)

Rules that follow from this:

  1. Move and rename assets inside the Unity editor (or with the IDE's Unity-aware refactoring).
  2. Always commit the .meta file together with its asset, and delete them together.
  3. Keep Visible Meta Files as the version control mode and Force Text as asset serialization mode (Project Settings > Editor). Both are the defaults in new projects. See Git LFS & Unity Version Control.

Test yourself

How does a scene refer to a mesh asset it uses?

  1. By file path
  2. By the asset's GUID stored in its .meta file
  3. By the asset's file size
  4. By the asset's name only

Which folder should never be committed to version control?

  1. Assets
  2. ProjectSettings
  3. Packages
  4. Library

You tune a light's intensity during Play mode and press Stop. What happens to the change?

  1. It is saved to the scene
  2. It is lost unless you copy the component values and paste them after stopping
  3. It is saved to the prefab
  4. Unity asks you to keep it