Unity uses C# scripts attached to GameObjects—MonoBehaviour lifecycle methods like Start and Update run in the Editor and player builds. The playground cannot run Unity Engine APIs; learn syntax here, then open Unity Hub locally.
MonoBehaviour sketch
public class PlayerController : MonoBehaviour {
void Start() {
Debug.Log("Scene loaded");
}
void Update() {
// per-frame logic
}
}
Unity uses its own serialization, asset pipeline, and physics—distinct from console dotnet run but the same C# language features (classes, properties, events).
How this track connects
- Classes, inheritance, and interfaces map directly to Unity components
- Events and delegates power UI callbacks
- Async/await appears in modern Unity for I/O, not per-frame
Updatehot paths
Important interview questions and answers
- Q: Unity vs .NET console?
A: Unity embeds Mono/IL2CPP runtime with engine APIs; not every NuGet package works in all build targets. - Q: Update vs FixedUpdate?
A:Updateruns per rendered frame;FixedUpdatealigns with physics timestep—gameplay vs physics separation.
Self-check
- What base class do Unity gameplay scripts inherit?
- Can you run Unity scripts in this playground?
Tip: Unity uses C# for gameplay scripts but runs in the Editor with its own lifecycle—MonoBehaviour hooks differ from console Main.
Interview prep
- Unity vs console C#?
Unity scripts inherit
MonoBehaviourwith lifecycle hooks (Start,Update)—not aMainentry point.- Unity uses which .NET?
Unity ships its own runtime (Mono or IL2CPP depending on platform)—not identical to latest .NET SDK versions.